php-src/Zend/tests/bug72215_1.phpt
Dmitry Stogov 3b8cb2119b Fixed bug #72347 (VERIFY_RETURN type casts visible in finally)
Fixed bug #72216 (Return by reference with finally is not memory safe)
Fixed bug #72215 (Wrong return value if var modified in finally)
2016-07-13 15:08:28 +03:00

22 lines
278 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 = 2;
}
}
$x = 1;
$y =& test($x);
var_dump($y);
$x = 3;
var_dump($y);
?>
--EXPECT--
int(2)
int(3)