Closed
Description
https://wiki.php.net/rfc/nullsafe_operator
$foo = $a?->b();
// --------------- chain 1
// -------- chain 2
// If $a is null chain 2 is aborted, method b() isn't called, null is assigned to $foo
$a?->b($c->d());
// --------------- chain 1
// ------- chain 2
// If $a is null chain 1 is aborted, method b() isn't called, the expression `$c->d()` is not evaluated
$a->b($c?->d());
// --------------- chain 1
// -------- chain 2
// If $c is null chain 2 is aborted, method d() isn't called, null is passed to `$a->b()`
This appears to be straightforward - T_NULLSAFE_OBJECT_OPERATOR looks to have the same precedence and places it can occur as T_OBJECT_OPERATOR(->
)
Metadata
Metadata
Assignees
Labels
No labels