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
Seems to me like it should also resolve to int for objects, like it does for arrays, since the "undefined"/"might not exist" issue is handled as a separate error. This would also fix a related issue I encountered in a project where I'm using PHPStan.
On the other hand, an attempt to fix this revealed a test case (added in this commit) that explicitly expects an error type in a similar scenario.
So I'm not sure - is this difference between arrays and objects intentional or accidental?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Is this intentional?
Seems to me like it should also resolve to
intfor objects, like it does for arrays, since the "undefined"/"might not exist" issue is handled as a separate error. This would also fix a related issue I encountered in a project where I'm using PHPStan.On the other hand, an attempt to fix this revealed a test case (added in this commit) that explicitly expects an error type in a similar scenario.
So I'm not sure - is this difference between arrays and objects intentional or accidental?
Beta Was this translation helpful? Give feedback.
All reactions