You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Attempting to access $foo::class on a potentially null $foo does not throw a warning, despite this throwing a null error if $foo is null.
A side effect of this, and where i first noticed the issue, is that the warning gets misplaced in match calls:
$baz = match ($foo::class) { // no null warning here
Foo::class => $foo->foo(), // null warning occurs here instead
Bar::class => $foo->bar(), // and heredefault => []
};
Expected behaviour
Attempting to access $foo::class when $foo may be null should be marked as "Null pointer exception may occur here".
Thus, in the match example above, the warning should not occur in the match arms because they aren't reachable if $foo is null.
Environment details
PHPStorm Build #PS-242.20224.361, built on August 10, 2024
Runtime version: 21.0.3+13-b509.4 amd64 (JCEF 122.1.9)
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
The text was updated successfully, but these errors were encountered:
Current behaviour
Attempting to access
$foo::class
on a potentially null$foo
does not throw a warning, despite this throwing a null error if$foo
is null.A side effect of this, and where i first noticed the issue, is that the warning gets misplaced in
match
calls:Expected behaviour
Attempting to access
$foo::class
when$foo
may be null should be marked as "Null pointer exception may occur here".Thus, in the match example above, the warning should not occur in the match arms because they aren't reachable if $foo is null.
Environment details
PHPStorm Build #PS-242.20224.361, built on August 10, 2024
Runtime version: 21.0.3+13-b509.4 amd64 (JCEF 122.1.9)
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
The text was updated successfully, but these errors were encountered: