mirror of
https://github.com/php/php-src.git
synced 2025-08-19 17:04:47 +02:00
- Update docu
This commit is contained in:
parent
0b3ed59fb6
commit
f33adafab7
2 changed files with 13 additions and 5 deletions
|
@ -25,17 +25,24 @@ interface SeekableIterator implements Iterator
|
||||||
* \param $index position to seek to
|
* \param $index position to seek to
|
||||||
* \return void
|
* \return void
|
||||||
*
|
*
|
||||||
* \note The method should throw an exception if it is not possible to
|
* The method should throw an exception if it is not possible to seek to
|
||||||
* seek to the given position.
|
* the given position. Typically this exception should be of type
|
||||||
*/
|
* OutOfBoundsException.
|
||||||
|
\code
|
||||||
function seek($index);
|
function seek($index);
|
||||||
/* $this->rewind();
|
$this->rewind();
|
||||||
$position = 0;
|
$position = 0;
|
||||||
while($position < $index && $this->valid()) {
|
while($position < $index && $this->valid()) {
|
||||||
$this->next();
|
$this->next();
|
||||||
$position++;
|
$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();
|
function getArrayCopy();
|
||||||
|
|
||||||
/** @param $position offset to seek to
|
/** @param $position offset to seek to
|
||||||
|
* @throw OutOfBoundsException if $position is invalid
|
||||||
*/
|
*/
|
||||||
function seek($position);
|
function seek($position);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue