Re: svn: /php/php-src/trunk/ UPGRADING ext/reflection/php_reflection.c ext/reflection/tests/ReflectionParameter_canBePassedByValue.phpt
| From: | Gustavo Lopes | Date: | Tue, 26 Oct 2010 16:45:28 +0000 |
| Subject: | Re: svn: /php/php-src/trunk/ UPGRADING ext/reflection/php_reflection.c ext/reflection/tests/ReflectionParameter_canBePassedByValue.phpt | ||
| References: | 1 2 | Groups: | php.cvs |
| Request: | Send a blank email to php-cvs+get-63723@lists.php.net to get a copy of this message | ||
On Tue, 26 Oct 2010 17:41:30 +0100, Pierre Joye <pierre.php@gmail.com> wrote:
hi Gustavo, I'm not sure it makes sense to add a method to do the opposite of ::isPassedByReference. I'm also not sure about ZEND_SEND_PREFER_REF being considered as by value in your implementation. What is the logic/reasoning behind this addition?It's not the opposite of isPassedByReference(). There are three possible values for the pass_by_reference "zend_bool" (taking advantage of its 8-bits...):
785 #define ZEND_SEND_BY_VAL 0
786 #define ZEND_SEND_BY_REF 1
787 #define ZEND_SEND_PREFER_REF 2
With ZEND_SEND_PREFER_REF, the parameter is sent by reference, but if it's not possible, instead of giving an error, it allows the value.
That's what canBePassedByValue tests; whether sending a value would give an error or not.
--
Gustavo Lopes