note 13812 added to control-structures.foreach.php

From: Date: Wed, 04 Jul 2001 09:07:04 +0000
Subject: note 13812 added to control-structures.foreach.php
Groups: php.notes 
Request: Send a blank email to php-notes+get-14963@lists.php.net to get a copy of this message
I think foreach would be more useful if we could work not on a copy of the array but on the array itself, at least as an option.<br> In my mind a statement like:<br> foreach ($array as $key => &$value)<br> should allow us to modify the array elements.<br>I think it would be nice, as 1) the programmer explicitly asks for a reference to the 'real' value and 2) it is backward compatible http://www.php.net/manual/en/control-structures.foreach.php

« previous php.notes (#14963) next »