diff options
| author | Marcus Boerger <helly@php.net> | 2004-04-28 21:52:51 +0000 |
|---|---|---|
| committer | Marcus Boerger <helly@php.net> | 2004-04-28 21:52:51 +0000 |
| commit | 1721e5d44e9d8d69fd23207cf707188d01b01576 (patch) | |
| tree | ea9c930982782ee6d10dabc0f5c55300d4af8e4e /ext/spl/examples/appenditerator.inc | |
| parent | 69e792ee7b6f9e9a965dda3b72ea990e5ea77f9c (diff) | |
| download | php-git-1721e5d44e9d8d69fd23207cf707188d01b01576.tar.gz | |
- More examples
Diffstat (limited to 'ext/spl/examples/appenditerator.inc')
| -rwxr-xr-x | ext/spl/examples/appenditerator.inc | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/ext/spl/examples/appenditerator.inc b/ext/spl/examples/appenditerator.inc index bd8e3c6fa4..48cc439ee3 100755 --- a/ext/spl/examples/appenditerator.inc +++ b/ext/spl/examples/appenditerator.inc @@ -18,6 +18,11 @@ class AppendIterator implements Iterator function append(Iterator $it) { $this->iterators->append($it); + if (!$this->valid()) + { + $this->iterators->seek($this->iterators->count() - 1); + $this->iterators->current()->rewind(); + } } function getInnerIterator() @@ -30,7 +35,7 @@ class AppendIterator implements Iterator $this->iterators->rewind(); if ($this->iterators->valid()) { - $this->iterators->rewind(); + $this->getInnerIterator()->rewind(); } } |
