xref: /PHP-7.2/Zend/tests/try/bug70228_2.phpt (revision 2ae21abd)
1--TEST--
2Bug #70228 (memleak if return in finally block)
3--FILE--
4<?php
5function test() {
6    try {
7        throw new Exception(1);
8    } finally {
9        try {
10            throw new Exception(2);
11        } finally {
12            return 42;
13        }
14    }
15}
16
17var_dump(test());
18?>
19--EXPECT--
20int(42)
21