double-start.phpt 390 B

1234567891011121314151617181920
  1. --TEST--
  2. Start on already running fiber
  3. --FILE--
  4. <?php
  5. $fiber = new Fiber(function (): void {
  6. Fiber::suspend();
  7. });
  8. $fiber->start();
  9. $fiber->start();
  10. ?>
  11. --EXPECTF--
  12. Fatal error: Uncaught FiberError: Cannot start a fiber that has already been started in %sdouble-start.php:%d
  13. Stack trace:
  14. #0 %sdouble-start.php(%d): Fiber->start()
  15. #1 {main}
  16. thrown in %sdouble-start.php on line %d