|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2011-01-13 03:25 UTC] aharvey@php.net
-Status: Open
+Status: Bogus
[2011-01-13 03:25 UTC] aharvey@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Tue Feb 10 10:00:01 2026 UTC |
Description: ------------ when I declare array and make foreach step 1: foreach ($list as &$rec) { then make step 2: foreach ($list as $rec) { and last element of $list at the moment "step 1" will broken after executing of "step 2" with data of last element of $list at the moment "step 2" ps: checked under different versions including 5.2.17 when you make unset($rec) before calling "step 2" bug will not appear. Test script: --------------- $list = array(1, 2, 3, 4, 5); foreach($list as &$rec); echo '<pre>'.print_r($list, 1).'</pre>'; $list[] = 6; $list[] = 7; foreach($list as $rec); echo '<pre>'.print_r($list, 1).'</pre>';