|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2017-05-17 17:59 UTC] bwoebi@php.net
[2017-05-17 17:59 UTC] bwoebi@php.net
-Status: Open
+Status: Closed
[2017-05-17 17:59 UTC] bwoebi@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Nov 09 14:00:01 2025 UTC |
Description: ------------ Nesting a try/finally inside a try/catch in a loop within a Generator will cause too many live vars to be cleaned up (i.e. outside its live range). Test script: --------------- function gen() { $array = ["foo"]; $array[] = "bar"; foreach ($array as $item) { try { try { yield; } finally { echo "fin $item\n"; } } catch (\Exception $e) { echo "catch\n"; continue; } } } $g = gen(); $g->throw(new Exception); Expected result: ---------------- fin foo catch fin bar Actual result: -------------- fin foo catch fin bar <segmentation fault>