note 94926 deleted from class.arrayiterator by googleguy
| From: | googleguy@php.net | Date: | Sat, 19 Jan 2013 03:45:54 +0000 |
| Subject: | note 94926 deleted from class.arrayiterator by googleguy | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-193242@lists.php.net to get a copy of this message | ||
Note Submitter: liranuna at liranuna dot com
----
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);
?>