If a zval is a callable object, how can I run it in my extension c code ?
or how to convert a zval
to a zend_fcall_info
If a zval is a callable object, how can I run it in my extension c code ?
or how to convert a zval
to a zend_fcall_info
after search for the zend_is_callable
and dive into the php src code, I know how to call a callable zval:
zval ret;
zval* params[] = { param }; // param is zval* too
if (SUCCESS == call_user_function(CG(function_table), NULL, callable, &retval, 1, params TSRMLS_CC)) {
// callable is a zval*
// you can do something with the retval now
}