mirror of
https://github.com/php/php-src.git
synced 2024-09-28 21:36:12 +00:00
16 lines
233 B
PHP
16 lines
233 B
PHP
|
<?php
|
||
|
|
||
|
class SeekableIterator implements Iterator
|
||
|
{
|
||
|
function seek($index) {
|
||
|
$this->rewind();
|
||
|
$position = 0;
|
||
|
while($position < $index && $this->it->hasMore()) {
|
||
|
$this->next();
|
||
|
$position++;
|
||
|
}
|
||
|
return $position;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
?>
|