php-src/Zend/tests/bug69740.phpt

29 lines
409 B
Plaintext
Raw Normal View History

2015-06-11 23:40:10 +08:00
--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 in %s:%d
2015-06-11 23:40:10 +08:00
Stack trace:
#0 {main}
thrown in %s on line %d