mirror of
https://github.com/php/php-src.git
synced 2025-01-08 12:04:24 +08:00
41 lines
473 B
PHP
41 lines
473 B
PHP
--TEST--
|
|
Bug #71601 (finally block not executed after yield from)
|
|
--FILE--
|
|
<?php
|
|
|
|
function gen1() {
|
|
try {
|
|
yield 1;
|
|
yield 2;
|
|
return true;
|
|
} finally {
|
|
echo "Inner finally\n";
|
|
}
|
|
}
|
|
|
|
function gen2() {
|
|
try {
|
|
echo "Entered try/catch\n";
|
|
var_dump(yield from gen1());
|
|
} finally {
|
|
echo "Finally\n";
|
|
}
|
|
}
|
|
|
|
$generator = gen2();
|
|
|
|
var_dump($generator->current());
|
|
|
|
unset($generator);
|
|
|
|
echo "Done\n";
|
|
|
|
?>
|
|
--EXPECT--
|
|
Entered try/catch
|
|
int(1)
|
|
Inner finally
|
|
Finally
|
|
Done
|
|
|