1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
--TEST-- Bug #74606 (Segfault within try/catch/finally nesting in Generators) --FILE-- <?php 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; } } } gen()->throw(new Exception); ?> --EXPECT-- fin foo catch fin bar