xref: /PHP-8.2/Zend/tests/bug72215_1.phpt (revision 3b8cb211)
1--TEST--
2Bug #72215.1 (Wrong return value if var modified in finally)
3--FILE--
4<?php
5function &test(&$b) {
6    $a =& $b;
7    try {
8        return $a;
9    } finally {
10        $a = 2;
11    }
12}
13$x = 1;
14$y =& test($x);
15var_dump($y);
16$x = 3;
17var_dump($y);
18?>
19--EXPECT--
20int(2)
21int(3)
22