|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2011-03-22 14:46 UTC] aharvey@php.net
-Status: Open
+Status: Bogus
[2011-03-22 14:46 UTC] aharvey@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Sun May 24 10:00:01 2026 UTC |
Description: ------------ Affected PHP versions: 5.3.5 5.3.5 5.2.9 Bug reveals only in case when loop variables are SAME and second loop variable is NOT passed by reference. Test script: --------------- $items = array ( array('id' => 1), array('id' => 2), array('id' => 3), array('id' => 4) ); foreach ( $items as &$item ) { $item['foo'] = 'bar'; } // Expected $items id's: 1, 2, 3, 4 // Actualy: 1, 2, 3, 4 foreach ( $items as $item ) { // do nothing } // Expected $items id's: 1, 2, 3, 4 // Actualy: 1, 2, 3, 3 <-- BUG!