1--TEST--
2Try catch finally (goto in try/catch block)
3--CREDITS--
4adoy
5--FILE--
6<?php
7function foo($ret = FALSE) {
8    try {
9        try {
10            do {
11                goto label;
12            } while(0);
13            foreach (array() as $val) {
14                continue;
15            }
16        } finally {
17            var_dump("finally1");
18            throw new Exception("exception");
19        }
20    } catch (Exception $e) {
21        goto local;
22local:
23        var_dump("caught");
24        if ($ret) return "return";
25    } finally {
26       var_dump("finally2");
27    }
28
29label:
30   var_dump("label");
31}
32
33var_dump(foo());
34var_dump(foo(true));
35
36?>
37--EXPECT--
38string(8) "finally1"
39string(6) "caught"
40string(8) "finally2"
41string(5) "label"
42NULL
43string(8) "finally1"
44string(6) "caught"
45string(8) "finally2"
46string(6) "return"
47