Finally with return now works in generators too

This commit is contained in:
Nikita Popov 2012-08-24 13:52:16 +02:00
parent 68c1e1cfe9
commit 7cdf6367a5

View File

@ -0,0 +1,33 @@
--TEST--
Use of finally in generator with return
--FILE--
<?php
function gen() {
try {
try {
echo "before return\n";
return;
echo "after return\n";
} finally {
echo "before return in inner finally\n";
return;
echo "after return in inner finally\n";
}
} finally {
echo "outer finally run\n";
}
echo "code after finally\n";
yield; // force generator
}
$gen = gen();
$gen->rewind(); // force run
?>
--EXPECTF--
before return
before return in inner finally
outer finally run