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
If I apply the coalescing operator to a two-level array access ($foo[$one][$two]) where the second level is guaranteed to be set, phpstan does not take into account that the first level might be undefined.
If you run phpstan on the snippet below, it will complain that $name can never be null in sayHello1(). In sayHello2() however, the two levels are inverted. Here, the behavior is correct.
Bug report
If I apply the coalescing operator to a two-level array access (
$foo[$one][$two]
) where the second level is guaranteed to be set, phpstan does not take into account that the first level might be undefined.If you run phpstan on the snippet below, it will complain that
$name
can never benull
insayHello1()
. InsayHello2()
however, the two levels are inverted. Here, the behavior is correct.Code snippet that reproduces the problem
https://phpstan.org/r/766659f0-7300-4297-81ff-f32314bbb9ac
Expected output
The code should not produce any errors.
The text was updated successfully, but these errors were encountered: