diff options
Diffstat (limited to 'ext/spl/tests/dit_006.phpt')
-rw-r--r-- | ext/spl/tests/dit_006.phpt | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/ext/spl/tests/dit_006.phpt b/ext/spl/tests/dit_006.phpt index 9edbb9f157..ed1ceffc05 100644 --- a/ext/spl/tests/dit_006.phpt +++ b/ext/spl/tests/dit_006.phpt @@ -30,11 +30,12 @@ while ($di->valid()) { echo "Without seek we get $o\n"; -$p = 0; -$di->seek($o+1); -while ($di->valid()) { - $p++; - $di->next(); +try { + $p = 0; + $di->seek($o+1); + $p = 1; +} catch (\OutOfBoundsException $ex) { + echo $ex->getMessage() . PHP_EOL; } var_dump($n !== $m, $m === $o, $p === 0); @@ -44,6 +45,7 @@ var_dump($n !== $m, $m === $o, $p === 0); With seek(2) we get %d With seek(0) we get %d Without seek we get %d +Seek position %d is out of range bool(true) bool(true) bool(true) |