/
vshmidt
/
php
Обзор
Документация
Войти
/
vshmidt
/
php
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
ext/spl/tests/bug70561.phpt
23 строки
438 B
Bishop Bettini
Bug #70561: Fix DirectoryIterator to throw OutOfBoundsException
23 сен 2015, 18:14
23 сен 2015, 18:14
368d3ff
Код
Авторство
О чём код?
--TEST-- Bug #70561 (DirectoryIterator::seek should throw OutOfBoundsException) --FILE-- <?php $di = new DirectoryIterator(__DIR__ . '/..'); $cnt = 0; $di->rewind(); while ($di->valid()) { $cnt++; $di->next(); } try { $di->seek($cnt+1); } catch (OutOfBoundsException $ex) { echo $ex->getMessage() . PHP_EOL; } echo "Is valid? " . (int) $di->valid() . PHP_EOL; ?> --EXPECTF-- Seek position %d is out of range Is valid? 0