diff options
Diffstat (limited to 'Zend/tests')
-rw-r--r-- | Zend/tests/generators/exception_during_shutdown.phpt | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/Zend/tests/generators/exception_during_shutdown.phpt b/Zend/tests/generators/exception_during_shutdown.phpt new file mode 100644 index 0000000000..d9c8bd0175 --- /dev/null +++ b/Zend/tests/generators/exception_during_shutdown.phpt @@ -0,0 +1,30 @@ +--TEST-- +Generator exceptions during shutdown should not be swallowed +--FILE-- +<?php + +function gen() { + try { + echo "before yield\n"; + yield; + echo "after yield\n"; + } finally { + echo "before yield in finally\n"; + yield; + echo "after yield in finally\n"; + } + echo "after finally\n"; +} + +$gen = gen(); +$gen->rewind(); + +?> +--EXPECTF-- +before yield +before yield in finally + +Fatal error: Uncaught Error: Cannot yield from finally in a force-closed generator in %s:%d +Stack trace: +#0 {main} + thrown in %s on line %d |