summaryrefslogtreecommitdiff
path: root/Zend/tests/generators/bug74606.phpt
blob: ec5ef26ee15cce698a73c0d117f5ef9735cb3f2a (plain)
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