note 92886 deleted from control-structures.foreach by danbrown

From: Date: Thu, 13 Aug 2009 05:03:02 +0000
Subject: note 92886 deleted from control-structures.foreach by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-159429@lists.php.net to get a copy of this message
Note Submitter: virtuall at virtuall dot info ---- Since this bug is marked as bogus: http://bugs.php.net/bug.php?id=32088 If you have also run into this undocumented "feature" and dont want to rewrite all the code, here's the solution. Instead of: foreach ($a as $key => &$value) { unset($a[$key]); } use: foreach ($a as $key => $whatever) { $value = &$a[$key]; unset($a[$key]); }

« previous php.notes (#159429) next »