throw_uncaught.phpt 349 B

12345678910111213141516171819
  1. --TEST--
  2. Generator::throw() where the exception is not caught in the generator
  3. --FILE--
  4. <?php
  5. function gen() {
  6. yield 'thisThrows';
  7. yield 'notReached';
  8. }
  9. $gen = gen();
  10. var_dump($gen->throw(new RuntimeException('test')));
  11. ?>
  12. --EXPECTF--
  13. Fatal error: Uncaught RuntimeException: test in %s:%d
  14. Stack trace:
  15. #0 {main}
  16. thrown in %s on line %d