catch-then-suspend.phpt 401 B

12345678910111213141516171819202122232425
  1. --TEST--
  2. Catch exception thrown into fiber, then suspend again
  3. --FILE--
  4. <?php
  5. $fiber = new Fiber(function () {
  6. try {
  7. Fiber::suspend('in try');
  8. } catch (Exception $exception) {
  9. }
  10. Fiber::suspend('after catch');
  11. });
  12. var_dump($fiber->start());
  13. var_dump($fiber->throw(new Exception));
  14. var_dump($fiber->resume());
  15. ?>
  16. --EXPECT--
  17. string(6) "in try"
  18. string(11) "after catch"
  19. NULL