Re: References & multiple assigments

From: Date: Tue, 07 Nov 2000 15:34:09 +0000
Subject: Re: References & multiple assigments
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-37355@lists.php.net to get a copy of this message
At 17:24 07-11-00, Mårten Gustafson wrote:
Doing $c = $b = &$a; results in $a & $b being referenced while $c´s not. Shouldn´t the above statement be the same as: $b = &$a; $c = &$a;
No. The return value of a the 'var =& var' expression is the value of the variable, not a reference to it.
If not then I think it should be possible to write: $c = &$b = &$a; Currently this generates a parse error.
The current engine doesn't allow that. We'll try to thoroughly address the entire issue of references in a future version of the engine, but it won't be in the immediate future. Zeev -- Zeev Suraski <zeev@zend.com> +972-3-6139665, ext 105 http://www.zend.com/

« previous php.dev (#37355) next »