diff options
Diffstat (limited to 'ext/spl/examples/limititerator.inc')
| -rwxr-xr-x | ext/spl/examples/limititerator.inc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/ext/spl/examples/limititerator.inc b/ext/spl/examples/limititerator.inc index e471f5d0e4..9a87f6874f 100755 --- a/ext/spl/examples/limititerator.inc +++ b/ext/spl/examples/limititerator.inc @@ -33,7 +33,7 @@ class LimitIterator implements Iterator $this->it->seek($position); $this->pos = $position; } else { - while($this->pos < $position && $this->it->hasMore()) { + while($this->pos < $position && $this->it->valid()) { $this->next(); } } @@ -46,9 +46,9 @@ class LimitIterator implements Iterator $this->seek($this->offset); } - function hasMore() { + function valid() { return ($this->count == -1 || $this->pos < $this->offset + $this->count) - && $this->it->hasMore(); + && $this->it->valid(); } function key() { |
