|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2016-09-25 19:21 UTC] yohgaki@php.net
-Operating System: Windows 7
+Operating System: Irrelevant
-PHP Version: 5.6Git-2016-09-25 (snap)
+PHP Version: Irrelevant
[2016-09-25 19:21 UTC] yohgaki@php.net
[2016-10-03 20:51 UTC] bwoebi@php.net
-Status: Open
+Status: Not a bug
[2016-10-03 20:51 UTC] bwoebi@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Dec 18 17:00:02 2025 UTC |
Description: ------------ the code: class CC { private static $bt; public function run(&$a) { self::$bt[] = debug_backtrace(); $a = 222; } } function n(&$a) { (new CC())->run($a); } $a = [ 'a' => 1, 'b' => 2, 'c' => 3 ]; n($a['b']); echo '<pre>'; var_dump($a); -------------------- this generates the following: array(3) { ["a"]=> int(1) ["b"]=> &int(222) ["c"]=> int(3) } there is a "reference &" signal at "b". If I remove this line: "self::$bt[] = debug_backtrace();" its gone, it will work right, but why do this variable goes reference?