throw-in-multiple-destroyed-fibers-after-shutdown.phpt 963 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. --TEST--
  2. Throw in multiple destroyed fibers after shutdown
  3. --FILE--
  4. <?php
  5. $fiber = new Fiber(function (): void {
  6. $fiber1 = new Fiber(function (): void {
  7. try {
  8. Fiber::suspend();
  9. } finally {
  10. throw new Exception('test1');
  11. }
  12. });
  13. $fiber1->start();
  14. $fiber2 = new Fiber(function (): void {
  15. try {
  16. Fiber::suspend();
  17. } finally {
  18. throw new Exception('test2');
  19. }
  20. });
  21. $fiber2->start();
  22. Fiber::suspend();
  23. });
  24. $fiber->start();
  25. echo "done\n";
  26. ?>
  27. --EXPECTF--
  28. done
  29. Fatal error: Uncaught Exception: test1 in %sthrow-in-multiple-destroyed-fibers-after-shutdown.php:%d
  30. Stack trace:
  31. #0 [internal function]: {closure}()
  32. #1 {main}
  33. Next Exception: test2 in %sthrow-in-multiple-destroyed-fibers-after-shutdown.php:%d
  34. Stack trace:
  35. #0 [internal function]: {closure}()
  36. #1 {main}
  37. thrown in %sthrow-in-multiple-destroyed-fibers-after-shutdown.php on line %d