Bug #71601 [NEW]: finally block not executed after yield from

From: Date: Mon, 15 Feb 2016 18:32:31 +0000
Subject: Bug #71601 [NEW]: finally block not executed after yield from
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-199234@lists.php.net to get a copy of this message
From: trowski Operating system: Debian PHP version: 7.0Git-2016-02-15 (Git) Package: Scripting Engine problem Bug Type: Bug Bug description:finally block not executed after yield from Description: ------------ The finally block in the example generator below is not being executed after delegating to another generator with yield from. Test script: --------------- #!/usr/bin/env php <?php function gen1() { yield 1; yield 2; yield 3; return true; } function gen2() { try { echo "Entered try/catch\n"; yield from gen1(); } finally { echo "Finally\n"; } }; $generator = gen2(); echo $generator->current(), "\n"; unset($generator); echo "Done\n"; Expected result: ---------------- Entered try/catch 1 Finally Done Actual result: -------------- Entered try/catch 1 Done -- Edit bug report at https://bugs.php.net/bug.php?id=71601&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=71601&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=71601&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=71601&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=71601&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=71601&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=71601&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=71601&r=needscript Try newer version: https://bugs.php.net/fix.php?id=71601&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=71601&r=support Expected behavior: https://bugs.php.net/fix.php?id=71601&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=71601&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=71601&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=71601&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=71601&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=71601&r=dst IIS Stability: https://bugs.php.net/fix.php?id=71601&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=71601&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=71601&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=71601&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=71601&r=mysqlcfg

« previous php.bugs (#199234) next »