summaryrefslogtreecommitdiff
path: root/Zend/tests/try/try_finally_016.phpt
blob: f78a2914af2c047faaf152dab82f838f42ad588f (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
30
31
32
33
34
35
36
37
--TEST--
Exception during break 2
--FILE--
<?php

class A {
    public $a = 1;
    public $b = 2;

    public function __destruct() {
        throw new Exception;
    }
}

function foo() {
    foreach ([0] as $_) {
        foreach (new A as $value) {
            try {
                break 2;
            } catch (Exception $e) {
                echo "catch\n";
            } finally {
                echo "finally\n";
            }
        }
    }
}

try {
    foo();
} catch (Exception $e) {
    echo "outer catch\n";
}
?>
--EXPECT--
finally
outer catch