php-src/Zend/tests/assign_obj_ref_byval_function.phpt
2019-04-08 10:18:26 +02:00

21 lines
328 B
PHP

--TEST--
Assign result of by-value function to object property by-reference
--FILE--
<?php
function notRef() {
return null;
}
$obj = new stdClass;
$obj->prop =& notRef();
var_dump($obj);
?>
--EXPECTF--
Notice: Only variables should be assigned by reference in %s on line %d
object(stdClass)#1 (1) {
["prop"]=>
NULL
}