catch.phpt 358 B

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