Re: [PHP-DEV] Recommended way to create a zval that serves as a callback in an extension

2012-07-20 Thread Adam Jon Richardson
On Thu, Jul 19, 2012 at 2:49 PM, Sara Golemon wrote: > Same as you would in PHP code. Make an IS_STRING pointing at a global > function, or IS_ARRAY pointing at a class method, or an IS_OBJECT supporting > __invoke(). If you're asking how you can call a C function directly via > this callback: Y

Re: [PHP-DEV] Recommended way to create a zval that serves as a callback in an extension

2012-07-19 Thread Sara Golemon
Same as you would in PHP code. Make an IS_STRING pointing at a global function, or IS_ARRAY pointing at a class method, or an IS_OBJECT supporting __invoke(). If you're asking how you can call a C function directly via this callback: You can't. You can can, however, make an internal method to us

[PHP-DEV] Recommended way to create a zval that serves as a callback in an extension

2012-07-14 Thread Adam Jon Richardson
Hi, I'm calling the function php_pcre_replace() in my extension: http://lxr.php.net/xref/PHP_5_4/ext/pcre/php_pcre.c#952 I would like to use a callback for the replace_val, but this will be supplied by my extension. I'm wondering what the recommended way of creating the replace_val zval callback