PHP 4.0 Bug #2753 Updated: Cannot return references from functions

From: Date: Fri, 09 Jun 2000 12:37:36 +0000
Subject: PHP 4.0 Bug #2753 Updated: Cannot return references from functions
Groups: php.dev 
Request: Send a blank email to php-dev+get-20722@lists.php.net to get a copy of this message
ID: 2753 Updated by: hholzgra Reported By: duncan@emarketeers.com Status: Closed Bug Type: Feature/Change Request Assigned To: Comments: it has been implemented in 12/1999, this was the original commit message: ndi and I finished working on the return references support in Zend. We tested it a bit, and merged it into the main branch. To return a reference from a function, you must tag the function as a function that returns a reference: function &foo($a, $b, $c) { ... } However, $a = foo(...) will still not cause $a to be a reference to the returned value (much like $a = $b, when $b is a reference, copies the value of $b onto $a, and doesn't make $a to be a reference to $b). In order to make $a be a reference to the returned value, you must use the notation: $a = &foo(); Full Bug description available at: http://bugs.php.net/version4/?id=2753

« previous php.dev (#20722) next »