1
0
mirror of https://github.com/php/php-src.git synced 2026-04-13 11:02:55 +02:00
Files
archived-php-src/Zend/tests/bug69740.phpt
Nikita Popov 8405265578 Fix bug #69740
2015-06-11 17:40:10 +02:00

29 lines
421 B
PHP

--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