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 use as a callback, just bear in mind it'll be callable
by userspace as well.

-Sara


On Sat, Jul 14, 2012 at 2:00 PM, Adam Jon Richardson <adamj...@gmail.com>wrote:

> 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 would be in the extension.
>
> Thank you for your patience and help.
>
> Adam
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

Reply via email to