mirror of
https://github.com/php/php-src.git
synced 2026-03-26 17:22:15 +01:00
RFC: https://wiki.php.net/rfc/nullsafe_operator Closes GH-5619. Co-authored-by: Nikita Popov <nikita.ppv@gmail.com>
24 lines
304 B
PHP
24 lines
304 B
PHP
--TEST--
|
|
Test nullsafe in sub-chain of function argument
|
|
--FILE--
|
|
<?php
|
|
|
|
function takes_ref(&$foo) {
|
|
$foo = 'foo';
|
|
}
|
|
|
|
function &returns_ref($ref) {
|
|
global $foo;
|
|
return $foo;
|
|
}
|
|
|
|
global $foo;
|
|
|
|
$null = null;
|
|
takes_ref(returns_ref($null?->null()));
|
|
var_dump($foo);
|
|
|
|
?>
|
|
--EXPECT--
|
|
string(3) "foo"
|