1
0
mirror of https://github.com/php/php-src.git synced 2026-03-26 01:02:25 +01:00
Files
archived-php-src/Zend/tests/nullsafe_operator/028.phpt
Ilija Tovilo 9bf119832d Implement nullsafe ?-> operator
RFC: https://wiki.php.net/rfc/nullsafe_operator

Closes GH-5619.

Co-authored-by: Nikita Popov <nikita.ppv@gmail.com>
2020-07-24 10:05:03 +02:00

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"