php-src/Zend/tests/assign_ref_func_leak.phpt
Nikita Popov df08d6bffe Fix leak in assign_ref with function
As far as I can see, the retval copying is already done in all
callers of this function, so it should not be duplicated here.
2019-12-18 17:18:10 +01:00

24 lines
325 B
PHP

--TEST--
Assigning the result of a non-reference function by-reference should not leak
--FILE--
<?php
function func() {
return [0];
}
$x = $y =& func();
var_dump($x, $y);
?>
--EXPECTF--
Notice: Only variables should be assigned by reference in %s on line %d
array(1) {
[0]=>
int(0)
}
array(1) {
[0]=>
int(0)
}