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.
29 lines
486 B
29 lines
486 B
--TEST--
|
|
Nullsafe method calls preserve private visibility when required
|
|
--FILE--
|
|
<?php
|
|
|
|
final class NullsafePrivateScope
|
|
{
|
|
private function value(): string
|
|
{
|
|
return 'private-ok';
|
|
}
|
|
|
|
public function read(?self $object): ?string
|
|
{
|
|
return $object?->value();
|
|
}
|
|
}
|
|
|
|
function main(): void
|
|
{
|
|
$object = new NullsafePrivateScope();
|
|
var_dump($object->read($object));
|
|
var_dump($object->read(null));
|
|
}
|
|
|
|
?>
|
|
--EXPECT--
|
|
string(10) "private-ok"
|
|
NULL
|
|
|