From: Marcus Boerger Date: Fri, 3 Mar 2006 22:56:27 +0000 (+0000) Subject: - Fix issue with LimitIterator X-Git-Tag: RELEASE_1_2~11 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b9630ddf52bc802abcd82dc3ebee9d338b1a6077;p=php - Fix issue with LimitIterator --- diff --git a/ext/spl/tests/iterator_032.phpt b/ext/spl/tests/iterator_032.phpt new file mode 100755 index 0000000000..7d15456155 --- /dev/null +++ b/ext/spl/tests/iterator_032.phpt @@ -0,0 +1,48 @@ +--TEST-- +SPL: LimitIterator::getPosition() +--SKIPIF-- + +--FILE-- +$v) +{ + echo "$k=>$v\n"; + var_dump($it->getPosition()); +} + +try +{ + $it->seek(0); +} +catch(OutOfBoundsException $e) +{ + echo $e->getMessage() . "\n"; +} + +$it->seek(2); +var_dump($it->current()); + +try +{ + $it->seek(3); +} +catch(OutOfBoundsException $e) +{ + echo $e->getMessage() . "\n"; +} + +?> +===DONE=== + +--EXPECT-- +1=>2 +int(1) +2=>3 +int(2) +Cannot seek to 0 which is below the offset 1 +int(3) +Cannot seek to 3 which is behind offest 1 plus count 2 +===DONE===