mirror of
https://github.com/php/php-src.git
synced 2024-12-18 14:30:35 +08:00
580eb56fb7
Conflicts: Zend/zend_generators.c
29 lines
409 B
PHP
29 lines
409 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 in %s:%d
|
|
Stack trace:
|
|
#0 {main}
|
|
thrown in %s on line %d
|