note 40962 deleted from internals2.ze1.zendapi by cmb

From: Date: Sun, 10 Jan 2021 13:26:30 +0000
Subject: note 40962 deleted from internals2.ze1.zendapi by cmb
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-216138@lists.php.net to get a copy of this message
Note Submitter: Julien CROUZET jucrouzet_at_cpan.org ---- 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

« previous php.notes (#216138) next »