|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2011-05-26 00:28 UTC] pierrick@php.net
-Status: Open
+Status: Bogus
[2011-05-26 00:28 UTC] pierrick@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 01 22:00:02 2025 UTC |
Description: ------------ I'm not sure if it's the right behavior, but seems that PHP doing it wrong, see the test script. Test script: --------------- $v = array(); $data = array('v1' => '0'); foreach($data as $k => &$v) ; foreach(array('v2' => '1') as $k => $v) ; var_dump($data); Expected result: ---------------- array(1) { ["v1"]=> &string(1) "0" } Actual result: -------------- array(1) { ["v1"]=> &string(1) "1" }