php-src/ext/spl/tests/bug51119.phpt
Fabien Villepinte a555cc0b3d Clean DONE tags from tests
Remove most of the `===DONE===` tags and its variations.
Keep `===DONE===` if the test output otherwise becomes empty.

Closes GH-4872.
2019-11-07 21:31:47 +01:00

33 lines
588 B
PHP

--TEST--
SPL: LimitIterator zero is valid offset
--FILE--
<?php
$array = array('a', 'b', 'c');
$arrayIterator = new ArrayIterator($array);
try {
$limitIterator = new LimitIterator($arrayIterator, 0);
foreach ($limitIterator as $item) {
echo $item . "\n";
}
} catch (OutOfRangeException $e){
print $e->getMessage() . "\n";
}
try {
$limitIterator = new LimitIterator($arrayIterator, -1);
foreach ($limitIterator as $item) {
echo $item . "\n";
}
} catch (OutOfRangeException $e){
print $e->getMessage() . "\n";
}
?>
--EXPECT--
a
b
c
Parameter offset must be >= 0