xref: /PHP-7.1/Zend/tests/try/bug72213.phpt (revision 2ae21abd)
1--TEST--
2Bug #72213 (Finally leaks on nested exceptions)
3--FILE--
4<?php
5function test() {
6	try {
7		throw new Exception('a');
8	} finally {
9		try {
10			throw new Exception('b');
11		} finally {
12		}
13	}
14}
15
16try {
17	test();
18} catch (Exception $e) {
19	var_dump($e->getMessage());
20	var_dump($e->getPrevious()->getMessage());
21}
22?>
23--EXPECT--
24string(1) "b"
25string(1) "a"
26