source: src/router/php7/Zend/tests/try/try_finally_027.phpt @ 31874

Last change on this file since 31874 was 31874, checked in by brainslayer, 3 months ago

update php

File size: 483 bytes
Line 
1--TEST--
2Return in try with throw in finally, inside other finally
3--FILE--
4<?php
5
6function test() {
7    try {
8        throw new Exception(1);
9    } finally {
10        try {
11            return 42;
12        } finally {
13            throw new Exception(2);
14        }
15    }
16}
17
18try {
19    test();
20} catch (Exception $e) {
21    echo $e, "\n";
22}
23
24?>
25--EXPECTF--
26Exception: 1 in %s:%d
27Stack trace:
28#0 %s(%d): test()
29#1 {main}
30
31Next Exception: 2 in %s:%d
32Stack trace:
33#0 %s(%d): test()
34#1 {main}
Note: See TracBrowser for help on using the repository browser.