|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2009-02-16 18:57 UTC] martin at itmission dot com
[2009-02-16 19:15 UTC] derick@php.net
[2009-02-16 19:32 UTC] martin at itmission dot com
[2015-01-01 20:19 UTC] chealer at gmail dot com
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 16:00:02 2025 UTC |
Description: ------------ When using foreach on an array using the reference syntax, stuff breaks later. Reproduce code: --------------- <?php $a = array(0, 1, 2, 3, 4); foreach($a as $k => &$v) { $v++; } foreach($a as $k => $v) { echo("$k => $v\n"); } ?> Expected result: ---------------- 0 => 1 1 => 2 2 => 3 3 => 4 4 => 5 Actual result: -------------- 0 => 1 1 => 2 2 => 3 3 => 4 4 => 4