mirror of
https://github.com/php/php-src.git
synced 2025-01-24 04:33:39 +08:00
- Update docu
This commit is contained in:
parent
0b3ed59fb6
commit
f33adafab7
@ -25,17 +25,24 @@ interface SeekableIterator implements Iterator
|
||||
* \param $index position to seek to
|
||||
* \return void
|
||||
*
|
||||
* \note The method should throw an exception if it is not possible to
|
||||
* seek to the given position.
|
||||
*/
|
||||
* The method should throw an exception if it is not possible to seek to
|
||||
* the given position. Typically this exception should be of type
|
||||
* OutOfBoundsException.
|
||||
\code
|
||||
function seek($index);
|
||||
/* $this->rewind();
|
||||
$this->rewind();
|
||||
$position = 0;
|
||||
while($position < $index && $this->valid()) {
|
||||
$this->next();
|
||||
$position++;
|
||||
}
|
||||
}*/
|
||||
if (!$this->valid()) {
|
||||
throw new OutOfBoundsException('Invalid seek position');
|
||||
}
|
||||
}
|
||||
\endcode
|
||||
*/
|
||||
function seek($index);
|
||||
}
|
||||
|
||||
?>
|
@ -548,6 +548,7 @@ class ArrayIterator implements SeekableIterator, ArrayAccess, Countable
|
||||
function getArrayCopy();
|
||||
|
||||
/** @param $position offset to seek to
|
||||
* @throw OutOfBoundsException if $position is invalid
|
||||
*/
|
||||
function seek($position);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user