Bug #71601 [Opn->Csd]: finally block not executed after yield from

From: Date: Mon, 15 Feb 2016 21:37:30 +0000
Subject: Bug #71601 [Opn->Csd]: finally block not executed after yield from
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-199236@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=71601&edit=1 ID: 71601 Updated by: bwoebi@php.net Reported by: trowski@php.net Summary: finally block not executed after yield from -Status: Open +Status: Closed Type: Bug Package: Scripting Engine problem Operating System: Debian PHP Version: 7.0Git-2016-02-15 (Git) Block user comment: N Private report: N New Comment: Automatic comment on behalf of bobwei9@hotmail.com Revision: http://git.php.net/?p=php-src.git;a=commit;h=23b770f31fdf893239a185bdb36876c5438eb813 Log: Fixed bug #71601 (finally block not executed after yield from) Previous Comments: ------------------------------------------------------------------------ [2016-02-15 18:32:29] trowski@php.net 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 this bug report at https://bugs.php.net/bug.php?id=71601&edit=1

« previous php.bugs (#199236) next »