xref: /PHP-8.1/Zend/tests/try/bug70228_6.phpt (revision 10f05625)
1--TEST--
2Bug #70228 (memleak if return in finally block)
3--FILE--
4<?php
5function test($x) {
6    foreach ($x as $v) {
7        try {
8            return str_repeat("a", 2);
9        } finally {
10            return 42;
11        }
12    }
13}
14
15var_dump(test([1]));
16?>
17--EXPECT--
18int(42)
19