mirror of
https://github.com/php/php-src.git
synced 2024-12-13 20:05:26 +08:00
df08d6bffe
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.
24 lines
325 B
PHP
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)
|
|
}
|