php-src/Zend/tests/generators/bug75396.phpt
Nikita Popov 420d11e8ca Fixed bug #75396
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.
2018-01-12 21:27:23 +01:00

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