|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2009-05-03 17:04 UTC] derick@php.net
[2009-05-04 00:34 UTC] scottmac@php.net
[2009-05-04 02:21 UTC] mike at clove dot com
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Sun May 24 21:00:01 2026 UTC |
Description: ------------ Assigning reference to an array element appears to modify the array element rather than simply creating a reference to it. This is surprising, to say the least. At least I think this is a bug and couldn't find anything with the same behavior and such minimal code. Reproduce code: --------------- $a = array(1,2); $r =& $a[0]; var_dump($a); Expected result: ---------------- array(2) { [0]=> int(1) [1]=> int(2) } Actual result: -------------- array(2) { [0]=> &int(1) [1]=> int(2) }