note 72115 added to control-structures.foreach
| From: | php-general at lists dot php dot net | Date: | Wed, 03 Jan 2007 13:29:40 +0000 |
| Subject: | note 72115 added to control-structures.foreach | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-121238@lists.php.net to get a copy of this message | ||
"Note: Unless the array is referenced, foreach operates on a copy of the specified array and
not the array itself. Therefore, the array pointer is not modified as with the each() construct, and
changes to the array element returned are not reflected in the original array. However, the internal
pointer of the original array is advanced with the processing of the array. Assuming the foreach
loop runs to completion, the array's internal pointer will be at the end of the array."
Am I the only person who thinks that this statement is completely contradictory? Either the pointer
of the original array is advanced, or it is not. This needs to be made a lot clearer.
----
Server IP: 216.194.113.175
Probable Submitter: 68.163.231.138
----
Manual Page -- http://www.php.net/manual/en/control-structures.foreach.php
Edit -- https://master.php.net/note/edit/72115
Del: integrated -- https://master.php.net/note/delete/72115/integrated
Del: useless -- https://master.php.net/note/delete/72115/useless
Del: bad code -- https://master.php.net/note/delete/72115/bad+code
Del: spam -- https://master.php.net/note/delete/72115/spam
Del: non-english -- https://master.php.net/note/delete/72115/non-english
Del: in docs -- https://master.php.net/note/delete/72115/in+docs
Del: other reasons-- https://master.php.net/note/delete/72115
Reject -- https://master.php.net/note/reject/72115
Search -- https://master.php.net/manage/user-notes.php