Re: PHP Extensions & Pass-By-Reference
| From: | Brad House | Date: | Sat, 26 Feb 2005 01:24:15 +0000 |
| Subject: | Re: PHP Extensions & Pass-By-Reference | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-15204@lists.php.net to get a copy of this message | ||
it's not defined in php4, only in php5
(you have to manually define it in php4
like this:
static unsigned char second_arg_force_ref[] = { 2, BYREF_NONE, BYREF_FORCE };
)
in php5 it's defined in
zend_modules.h
As far as usage, you pretty much define it as by reference, and just
set the variable as you'd like, just make sure you dereference
it (e.g. use *arg2 not arg2 or whatnot after getting the reference
using zend_get_parameters_ex)
-Brad
chris.cranford@tkdsoftware.com wrote:
On 2/25/2005 2:28 PM, BRAD@MAINSTREETSOFTWORKS.COM wrote to CHRIS CRANFORD: Where si the second_arg_force_ref argument defined? I tried to define an argument block but I kept getting compiler issues. An example would be nice. I followed what I saw on zend.com but no cigar. Chris -> 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: -> > 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 -> >