|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2012-09-14 09:45 UTC] laruence@php.net
[2012-09-14 09:52 UTC] charlie at charliesomerville dot com
[2012-09-14 09:55 UTC] laruence@php.net
[2012-09-14 09:55 UTC] laruence@php.net
-Status: Open
+Status: Analyzed
[2012-09-14 09:56 UTC] laruence@php.net
[2012-09-14 09:56 UTC] laruence@php.net
-Status: Analyzed
+Status: Feedback
[2012-09-14 13:31 UTC] nikic@php.net
[2013-02-18 00:36 UTC] php-bugs at lists dot php dot net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 05 08:00:02 2025 UTC |
Description: ------------ To be specific, this only occurs when passing a reference returned by a function into another function that takes a reference. This behaves as expected with a variable instead of a function call, so I believe this is a bug. Test script: --------------- <?php function &return_a() { global $a; return $a; } $a = [1,2,3]; array_shift(return_a()); print_r($a); $a = [1,2,3]; array_shift((return_a())); print_r($a); Expected result: ---------------- Array ( [0] => 2 [1] => 3 ) Array ( [0] => 2 [1] => 3 ) Actual result: -------------- Array ( [0] => 2 [1] => 3 ) Array ( [0] => 1 [1] => 2 [2] => 3 )