xref: /PHP-8.0/Zend/tests/bug72215_2.phpt (revision f8d79582)
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 =& $c;
11    $a = 2;
12    }
13}
14$x = 1;
15$y =& test($x);
16var_dump($y);
17$x = 3;
18var_dump($y);
19?>
20--EXPECT--
21int(1)
22int(3)
23