mirror of
https://github.com/php/php-src.git
synced 2024-12-19 15:00:15 +08:00
3b8cb2119b
Fixed bug #72216 (Return by reference with finally is not memory safe) Fixed bug #72215 (Wrong return value if var modified in finally)
23 lines
289 B
PHP
23 lines
289 B
PHP
--TEST--
|
|
Bug #72215.1 (Wrong return value if var modified in finally)
|
|
--FILE--
|
|
<?php
|
|
function &test(&$b) {
|
|
$a =& $b;
|
|
try {
|
|
return $a;
|
|
} finally {
|
|
$a =& $c;
|
|
$a = 2;
|
|
}
|
|
}
|
|
$x = 1;
|
|
$y =& test($x);
|
|
var_dump($y);
|
|
$x = 3;
|
|
var_dump($y);
|
|
?>
|
|
--EXPECT--
|
|
int(1)
|
|
int(3)
|