/
vshmidt
/
php
Обзор
Документация
Войти
/
vshmidt
/
php
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
ext/reflection/tests/ReflectionFiber_errors.phpt
71 строка
2 KB
Aaron Piotrowski
Implement Fibers
26 апр 2021, 19:07
Не верифицирован
26 апр 2021, 19:07
c276c16
Код
Авторство
О чём код?
--TEST-- ReflectionFiber errors --FILE-- <?php $fiber = new Fiber(function (): void { Fiber::suspend(); }); $reflection = new ReflectionFiber($fiber); try { $reflection->getTrace(); } catch (Error $error) { echo $error->getMessage(), "\n"; } try { $reflection->getExecutingFile(); } catch (Error $error) { echo $error->getMessage(), "\n"; } try { $reflection->getExecutingLine(); } catch (Error $error) { echo $error->getMessage(), "\n"; } $fiber->start(); var_dump($reflection->getExecutingFile()); var_dump($reflection->getExecutingLine()); $fiber->resume(); try { $reflection->getTrace(); } catch (Error $error) { echo $error->getMessage(), "\n"; } try { $reflection->getExecutingFile(); } catch (Error $error) { echo $error->getMessage(), "\n"; } try { $reflection->getExecutingLine(); } catch (Error $error) { echo $error->getMessage(), "\n"; } try { $reflection->getCallable(); } catch (Error $error) { echo $error->getMessage(), "\n"; } ?> --EXPECTF-- Cannot fetch information from a fiber that has not been started or is terminated Cannot fetch information from a fiber that has not been started or is terminated Cannot fetch information from a fiber that has not been started or is terminated string(%d) "%s%eReflectionFiber_errors.php" int(4) Cannot fetch information from a fiber that has not been started or is terminated Cannot fetch information from a fiber that has not been started or is terminated Cannot fetch information from a fiber that has not been started or is terminated Cannot fetch the callable from a fiber that has terminated