note 72400 added to control-structures.foreach
| From: | GPatmore at osu1 dot php dot net | Date: | Wed, 17 Jan 2007 16:29:55 +0000 |
| Subject: | note 72400 added to control-structures.foreach | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-121839@lists.php.net to get a copy of this message | ||
In reference to the comment by Timon Van Overveldt...
Although your suggestion works for changing the original array, a copy of the original array is
still created for nothing. This may become a performance issue when used with a large array.
It has been suggested that if your code must be php4 compatible, use the alternative list()...each()
style explained above to iterate through an array if you don't need to use a copy.
----
Server IP: 216.194.113.175
Probable Submitter: 69.115.227.109
----
Manual Page -- http://www.php.net/manual/en/control-structures.foreach.php
Edit -- https://master.php.net/note/edit/72400
Del: integrated -- https://master.php.net/note/delete/72400/integrated
Del: useless -- https://master.php.net/note/delete/72400/useless
Del: bad code -- https://master.php.net/note/delete/72400/bad+code
Del: spam -- https://master.php.net/note/delete/72400/spam
Del: non-english -- https://master.php.net/note/delete/72400/non-english
Del: in docs -- https://master.php.net/note/delete/72400/in+docs
Del: other reasons-- https://master.php.net/note/delete/72400
Reject -- https://master.php.net/note/reject/72400
Search -- https://master.php.net/manage/user-notes.php