diff options
Diffstat (limited to 'Zend/tests/generators/throw_uncaught.phpt')
-rw-r--r-- | Zend/tests/generators/throw_uncaught.phpt | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/Zend/tests/generators/throw_uncaught.phpt b/Zend/tests/generators/throw_uncaught.phpt new file mode 100644 index 0000000000..f06cff1b8e --- /dev/null +++ b/Zend/tests/generators/throw_uncaught.phpt @@ -0,0 +1,19 @@ +--TEST-- +Generator::throw() where the exception is not caught in the generator +--FILE-- +<?php + +function gen() { + yield 'thisThrows'; + yield 'notReached'; +} + +$gen = gen(); +var_dump($gen->throw(new RuntimeException('test'))); + +?> +--EXPECTF-- +Fatal error: Uncaught exception 'RuntimeException' with message 'test' in %s:%d +Stack trace: +#0 {main} + thrown in %s on line %d |