resume-running-fiber.phpt 498 B

123456789101112131415161718192021
  1. --TEST--
  2. Resume running fiber
  3. --FILE--
  4. <?php
  5. $fiber = new Fiber(function (): void {
  6. $self = Fiber::getCurrent();
  7. $self->resume();
  8. });
  9. $fiber->start();
  10. ?>
  11. --EXPECTF--
  12. Fatal error: Uncaught FiberError: Cannot resume a fiber that is not suspended in %sresume-running-fiber.php:%d
  13. Stack trace:
  14. #0 %sresume-running-fiber.php(%d): Fiber->resume()
  15. #1 [internal function]: {closure}()
  16. #2 %sresume-running-fiber.php(%d): Fiber->start()
  17. #3 {main}
  18. thrown in %sresume-running-fiber.php on line %d