note 94926 added to class.arrayiterator
| From: | liranuna at liranuna dot com | Date: | Thu, 03 Dec 2009 02:44:11 +0000 |
| Subject: | note 94926 added to class.arrayiterator | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-163515@lists.php.net to get a copy of this message | ||
If you want to make your ArrayIterator support foreach loops with PHP's & operator, such as
<?php
foreach($list as &$item) {
....
}
?>
You will need to pass the array to ArrayIterator by reference:
<?php
new ArrayIterator(&$array);
?>
----
Server IP: 64.71.164.2
Probable Submitter: 98.210.192.54
----
Manual Page -- http://www.php.net/manual/en/class.arrayiterator.php
Edit -- https://master.php.net/note/edit/94926
Del: integrated -- https://master.php.net/note/delete/94926/integrated
Del: useless -- https://master.php.net/note/delete/94926/useless
Del: bad code -- https://master.php.net/note/delete/94926/bad+code
Del: spam -- https://master.php.net/note/delete/94926/spam
Del: non-english -- https://master.php.net/note/delete/94926/non-english
Del: in docs -- https://master.php.net/note/delete/94926/in+docs
Del: other reasons-- https://master.php.net/note/delete/94926
Reject -- https://master.php.net/note/reject/94926
Search -- https://master.php.net/manage/user-notes.php