Writing a PHP extension in C, I want to convert a userland object (IS_OBJECT
) to a string through __toString()
if it has one, and fail otherwise. What should I use?
I don't need another zval
on output, just a char *
.
zval *zo;
switch (Z_TYPE_P(zo)) {
case IS_STRING:
... Z_STRVAL_P(zo) ...
break;
case IS_OBJECT:
... ???(zo) ...
break;
...
}