php-8.0.30-src/Zend/tests/nullsafe_operator/028.phpt

25 lines
326 B
PHP

--TEST--
Test nullsafe in sub-chain of return as ref
--FILE--
<?php
function &returns_ref($unused) {
global $foo;
return $foo;
}
function &returns_ref2() {
$null = null;
return returns_ref($null?->null);
}
global $foo;
$foo2 = &returns_ref2();
$foo2 = 'foo';
var_dump($foo);
?>
--EXPECT--
string(3) "foo"