mirror of
https://github.com/php/php-src.git
synced 2026-03-26 09:12:14 +01:00
RFC: https://wiki.php.net/rfc/nullsafe_operator Closes GH-5619. Co-authored-by: Nikita Popov <nikita.ppv@gmail.com>
27 lines
381 B
PHP
27 lines
381 B
PHP
--TEST--
|
|
Nullsafe chain in static property / method name
|
|
--FILE--
|
|
<?php
|
|
|
|
class Test {
|
|
}
|
|
|
|
$null = null;
|
|
|
|
try {
|
|
Test::${$null?->foo}->bar;
|
|
} catch (Error $e) {
|
|
echo $e->getMessage(), "\n";
|
|
}
|
|
|
|
try {
|
|
Test::{$null?->foo}()->bar;
|
|
} catch (Error $e) {
|
|
echo $e->getMessage(), "\n";
|
|
}
|
|
|
|
?>
|
|
--EXPECT--
|
|
Access to undeclared static property Test::$
|
|
Method name must be a string
|