summaryrefslogtreecommitdiff
path: root/ext/spl
diff options
context:
space:
mode:
authorMarcus Boerger <helly@php.net>2005-03-01 23:44:05 +0000
committerMarcus Boerger <helly@php.net>2005-03-01 23:44:05 +0000
commitf33adafab717a0244aa964a15aa55b90f6bdd436 (patch)
tree9b6ecdc17977a49a74aae52db32c78839296a346 /ext/spl
parent0b3ed59fb6f231d4d6f4ea947450659c93350afe (diff)
downloadphp-git-f33adafab717a0244aa964a15aa55b90f6bdd436.tar.gz
- Update docu
Diffstat (limited to 'ext/spl')
-rwxr-xr-xext/spl/internal/seekableiterator.inc17
-rwxr-xr-xext/spl/spl.php1
2 files changed, 13 insertions, 5 deletions
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);