mirror of
https://github.com/php/php-src.git
synced 2025-01-08 12:04:24 +08:00
420d11e8ca
Do not run finally blocks in generators on unclean shutdown (e.g. caused by exit). This is consistent with how finally blocks outside of generators behave.
23 lines
279 B
PHP
23 lines
279 B
PHP
--TEST--
|
|
Bug #75396: Exit inside generator finally results in fatal error
|
|
--FILE--
|
|
<?php
|
|
|
|
$gen = (function () {
|
|
yield 42;
|
|
|
|
try {
|
|
echo "Try\n";
|
|
exit("Exit\n");
|
|
} finally {
|
|
echo "Finally\n";
|
|
}
|
|
})();
|
|
|
|
$gen->send("x");
|
|
|
|
?>
|
|
--EXPECT--
|
|
Try
|
|
Exit
|