note 40962 added to zend.structure.function-block
| From: | JulienCROUZETjucrouzet_at_cpan dot org at rn2 dot php dot net | Date: | Wed, 24 Mar 2004 19:44:09 +0000 |
| Subject: | note 40962 added to zend.structure.function-block | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-67120@lists.php.net to get a copy of this message | ||
As a completion to k at ailis dot de :
According to ARG_SHOULD_BE_SENT_BY_REF macro in zend_compile.h, BYREF_FORCE_REST force the rest of
the arguments to be passed as ref.
The first byte have to be the index of BYREF_FORCE_REST in the array.
Means, if you have, 5 args, the first two ones are NOT passed as ref, and the 3 others are, you can
do :
static unsigned char rest_arguments_force_ref[] = { 3, BYREF_NONE, BYREF_NONE, BYREF_FORCE_REST };
We can see a few things in this example :
* As k at ailis dot de said, the first byte is _NOT_ the number of args passed to the function.
* The argument corresponding to BYREF_FORCE_REST MUST be passed as a reference
* The others arguments MUST be passed as a reference
----
Manual Page -- http://www.php.net/manual/en/zend.structure.function-block.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+40962
Delete -- http://master.php.net/manage/user-notes.php?action=delete+40962&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+40962&report=yes
Search -- http://master.php.net/manage/user-notes.php