Re: [PHP4BETA] forcing passing by reference

From: Date: Wed, 12 May 1999 20:47:51 +0000
Subject: Re: [PHP4BETA] forcing passing by reference
References: 1  Groups: php.version4 
Request: Send a blank email to php-version4+get-820@lists.php.net to get a copy of this message
At 20:46 12/05/99 , Andrey Zmievski wrote:
When writing function entry definition, how can I force an argument to be passed by reference? Anything like third_arg_force_reference or something similar?
You can define your own struts, like third_arg_force_reference. Look at internal_functions.c, at the definitions of first_arg_force_ref and second_arg_force_ref. Essentially, the first element in that array is the number of elements that follow it, and then each element corresponds to a function argument. So, to implement third_arg_force_ref, you'd want: unsigned char third_arg_force_ref = { 3, BYREF_NONE, BYREF_NONE, BYREF_FORCE }; You'd notice BYREF_ALLOW in there as well. BYREF_ALLOW was a performance booster in PHP 3.0, and was rendered obsolete by the reference counting mechanism of Zend, so it's now deprecated and only available for downwards compatibility. Zeev -- Zeev Suraski <zeev@zend.com> http://www.zend.com/ For a PGP public key, finger bourbon@netvision.net.il -- PHP 4 Beta

« previous php.version4 (#820) next »