xref: /PHP-7.2/Zend/tests/try/try_finally_026.phpt (revision 2ae21abd)
1--TEST--
2Throw in finally inside catch inside finally
3--FILE--
4<?php
5
6function test() {
7    try {
8        throw new Exception(1);
9    } finally {
10        try {
11            throw new Exception(2);
12        } catch (Exception $e) {
13            try {
14            } finally {
15                throw new Exception(3);
16            }
17        }
18    }
19}
20
21try {
22    test();
23} catch (Exception $e) {
24    echo $e, "\n";
25}
26
27?>
28--EXPECTF--
29Exception: 1 in %s:%d
30Stack trace:
31#0 %s(%d): test()
32#1 {main}
33
34Next Exception: 3 in %s:%d
35Stack trace:
36#0 %s(%d): test()
37#1 {main}
38