TypePHP 编译器 https://swoole.com/aot/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

19 lines
340 B

--TEST--
Nullsafe operator - method and property access
--FILE--
<?php
class User {
public ?stdClass $prop = null;
}
function main() {
$user = new User();
var_dump($user?->prop?->data);
$user->prop = new stdClass();
$user->prop->data = 'hello';
var_dump($user?->prop?->data);
}
?>
--EXPECT--
NULL
string(5) "hello"