/
vshmidt
/
php
Обзор
Документация
Войти
/
vshmidt
/
php
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
ext/spl/tests/iterator_count_exception.phpt
20 строк
480 B
Tim Düsterhus
RFC: Make the `iterator_*()` family accept all `iterable`s (#8819)
19 июл 2022, 17:46
Не верифицирован
19 июл 2022, 17:46
7ae7df5
Код
Авторство
О чём код?
--TEST-- SPL: iterator_count() throws if the Iterator throws --FILE-- <?php function generator() { yield 1; throw new Exception('Iterator failed'); } var_dump(iterator_count(generator())); ?> --EXPECTF-- Fatal error: Uncaught Exception: Iterator failed in %siterator_count_exception.php:5 Stack trace: #0 [internal function]: generator() #1 %siterator_count_exception.php(8): iterator_count(Object(Generator)) #2 {main} thrown in %siterator_count_exception.php on line 5