|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2013-02-17 13:36 UTC] nikic@php.net
-Status: Open
+Status: Wont fix
-Package: Feature/Change Request
+Package: *General Issues
[2013-02-17 13:36 UTC] nikic@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 15:00:01 2025 UTC |
Description: ------------ Making a variable, which was passed by reference, a reference to another variable inside the function won't work outside this function Reproduce code: --------------- <?php function &testReference(&$first, &$second) { $source = 'my Test'; $first = $source; $second =& $source; var_dump($second); return $second; } $ref3 =& testReference($ref1, $ref2); var_dump($ref1); var_dump($ref2); var_dump($ref3); ?> Expected result: ---------------- string(7) "my Test" string(7) "my Test" string(7) "my Test" string(7) "my Test" Actual result: -------------- string(7) "my Test" string(7) "my Test" NULL string(7) "my Test"