note 73902 added to control-structures.foreach
| From: | Aaron at osu1 dot php dot net | Date: | Wed, 14 Mar 2007 21:37:01 +0000 |
| Subject: | note 73902 added to control-structures.foreach | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-124458@lists.php.net to get a copy of this message | ||
re: nickw at telus dot net
Seeing the exact same error. It always happens just like your example, where the last iteration of
foreach uses data from the second to last, instead of the actual last, row in the array.
It only seems to happen if I've used "foreach($columns as &$column)" (as opposed
to foreach($columns as $column)) earlier in the script, and goes away if I use that again, or if I
do an unset($column) before the foreach.
Sounds like a bug in php to me...
----
Server IP: 64.71.164.2
Probable Submitter: 129.123.17.215
----
Manual Page -- http://www.php.net/manual/en/control-structures.foreach.php
Edit -- https://master.php.net/note/edit/73902
Del: integrated -- https://master.php.net/note/delete/73902/integrated
Del: useless -- https://master.php.net/note/delete/73902/useless
Del: bad code -- https://master.php.net/note/delete/73902/bad+code
Del: spam -- https://master.php.net/note/delete/73902/spam
Del: non-english -- https://master.php.net/note/delete/73902/non-english
Del: in docs -- https://master.php.net/note/delete/73902/in+docs
Del: other reasons-- https://master.php.net/note/delete/73902
Reject -- https://master.php.net/note/reject/73902
Search -- https://master.php.net/manage/user-notes.php