note 103481 rejected from appenditerator.append by salathe
| From: | salathe@php.net | Date: | Fri, 15 Apr 2011 13:27:08 +0000 |
| Subject: | note 103481 rejected from appenditerator.append by salathe | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-178873@lists.php.net to get a copy of this message | ||
Note Submitter: benjamin dot delespierre at gmail dot com
----
Keep in mind that AppendIterator::append will rewind the iterator.
Example:
<?php
$it = new AppendIterator();
$it->append(new ArrayIterator(array(1,2,3)));
$it->append(new ArrayIterator(array(4,5,6)));
foreach ($it as $value) var_dump($value);
$it->append(new ArrayIterator(array(1,2,3)));
foreach ($it as $value) var_dump($value);
?>