Let’s say we have a custom PHP extension like:
PHP_RSHUTDOWN_FUNCTION(myextension)
{
// How do I call myfunction() from here?
return SUCCESS;
}
PHP_FUNCTION(myfunction)
{
// Do something here
...
RETURN_NULL;
}
How can I call myfunction() from the RSHUTDOWN handler?
Using the provided macros the call will be:
When you’re defining you function as
PHP_FUNCTION(myFunction)the preprocessor will expand you’re definition to:which in turn is:
The macros from zend.h and php.h: