|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2016-02-15 21:37 UTC] bwoebi@php.net
[2016-02-15 21:37 UTC] bwoebi@php.net
-Status: Open
+Status: Closed
[2016-02-15 21:44 UTC] bwoebi@php.net
[2016-07-20 11:33 UTC] davey@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Nov 03 12:00:02 2025 UTC |
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