throw-during-fiber-destruct.phpt 454 B

123456789101112131415161718192021
  1. --TEST--
  2. Make sure exceptions are rethrown when throwing from fiber destructor
  3. --FILE--
  4. <?php
  5. $fiber = new Fiber(function() {
  6. try {
  7. Fiber::suspend();
  8. } finally {
  9. throw new Exception("Exception 2");
  10. }
  11. });
  12. $fiber->start();
  13. unset($fiber);
  14. throw new Exception("Exception 1");
  15. ?>
  16. --EXPECTF--
  17. Fatal error: Uncaught Exception: Exception 2 in %s:%d
  18. Stack trace:
  19. #0 [internal function]: {closure}()
  20. #1 {main}
  21. thrown in %s on line %d