/
vshmidt
/
php
Обзор
Документация
Войти
/
vshmidt
/
php
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
ext/spl/tests/spl_iterator_apply_error.phpt
26 строк
477 B
Máté Kocsis
Declare tentative return types for ext/spl - part 1 (#7115)
13 июл 2021, 14:04
Не верифицирован
13 июл 2021, 14:04
c6357b8
Код
Авторство
О чём код?
--TEST-- SPL: Error: iterator_apply when an iterator method (eg rewind) throws exception --FILE-- <?php class MyArrayIterator extends ArrayIterator { public function rewind(): void { throw new Exception('Make the iterator break'); } } function test() {} $it = new MyArrayIterator(array(1, 21, 22)); try { $res = iterator_apply($it, 'test'); } catch (Exception $e) { echo $e->getMessage(); } ?> <?php exit(0); ?> --EXPECT-- Make the iterator break