diff options
author | Nikita Popov <nikic@php.net> | 2015-06-11 17:40:10 +0200 |
---|---|---|
committer | Nikita Popov <nikic@php.net> | 2015-06-11 17:40:10 +0200 |
commit | 8405265578d2df8d76be223910b3e44aff4bdfef (patch) | |
tree | 1c6ce6071418472c95bec0a449552b285bf4fc80 /Zend/tests/bug69740.phpt | |
parent | 702e349df4ef3cc91927efc0fc5caf0b59cd96e8 (diff) | |
download | php-git-8405265578d2df8d76be223910b3e44aff4bdfef.tar.gz |
Fix bug #69740
Diffstat (limited to 'Zend/tests/bug69740.phpt')
-rw-r--r-- | Zend/tests/bug69740.phpt | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/Zend/tests/bug69740.phpt b/Zend/tests/bug69740.phpt new file mode 100644 index 0000000000..30a2a49099 --- /dev/null +++ b/Zend/tests/bug69740.phpt @@ -0,0 +1,28 @@ +--TEST-- +Bug #69740: finally in generator (yield) swallows exception in iteration +--FILE-- +<?php + +function generate() { + try { + yield 1; + yield 2; + } finally { + echo "finally\n"; + } +} + +foreach (generate() as $i) { + echo $i, "\n"; + throw new Exception(); +} + +?> +--EXPECTF-- +1 +finally + +Fatal error: Uncaught exception 'Exception' in %s:%d +Stack trace: +#0 {main} + thrown in %s on line %d |