throw-into-non-running-fiber.phpt 418 B

12345678910111213141516
  1. --TEST--
  2. Throw into non-running fiber
  3. --FILE--
  4. <?php
  5. $fiber = new Fiber(fn() => null);
  6. $fiber->throw(new Exception('test'));
  7. ?>
  8. --EXPECTF--
  9. Fatal error: Uncaught FiberError: Cannot resume a fiber that is not suspended in %sthrow-into-non-running-fiber.php:%d
  10. Stack trace:
  11. #0 %sthrow-into-non-running-fiber.php(%d): Fiber->throw(Object(Exception))
  12. #1 {main}
  13. thrown in %sthrow-into-non-running-fiber.php on line %d