From: Marcus Boerger Date: Tue, 1 Mar 2005 23:44:05 +0000 (+0000) Subject: - Update docu X-Git-Tag: RELEASE_0_3~106 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f33adafab717a0244aa964a15aa55b90f6bdd436;p=php - Update docu --- diff --git a/ext/spl/internal/seekableiterator.inc b/ext/spl/internal/seekableiterator.inc index 586be27a7b..c00d264a95 100755 --- a/ext/spl/internal/seekableiterator.inc +++ b/ext/spl/internal/seekableiterator.inc @@ -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); } ?> \ No newline at end of file diff --git a/ext/spl/spl.php b/ext/spl/spl.php index dcf10f0c21..b3c699a4d2 100755 --- a/ext/spl/spl.php +++ b/ext/spl/spl.php @@ -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);