PHP Extensions & Pass-By-Reference

php.internals

Chris Cranford

21 years ago
I have a PHP_FUNCTION() defined in my PHP extension. How am I suppose to pass variables by reference to my function without enabling call-time pass by reference in the PHP.INI file? Thanks

Marcus Börger

21 years ago
Hello Chris, you need to define that signature of your functions by supplying ZEND_ARG_INFO's to them. look at ZEND_API.h file for those macros. marcus Friday, February 25, 2005, 2:22:39 AM, you wrote:
> I have a PHP_FUNCTION() defined in my PHP extension. How am I suppose to > pass variables by reference to my function without enabling call-time pass > by reference in the PHP.INI file?
> Thanks
-- Best regards, Marcus mailto:helly@php.net

Brad House

21 years ago
look at http://cvs.php.net/co.php/php-src/ext/mcve/mcve.c?r=1.28.2.2 the m_completeauthorizations function. -Brad Chris Cranford wrote:

Richard Lynch

21 years ago
Chris Cranford wrote:
> I have a PHP_FUNCTION() defined in my PHP extension. How am I suppose to > pass variables by reference to my function without enabling call-time pass > by reference in the PHP.INI file?
I think the definition in the C syntax of PHP_FUNCTION will do that for you. You'll probably need to use some ZEND_xxx macro. Check out simple functions (error_log springs to mind) that use pass by reference.
-- Like Music? http://l-i-e.com/artists.htm