1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- --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
|