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
I think I can get to work on this today.
Related PR’s phpstan/phpstan-src#1934 phpstan/phpstan-src#1929
I think we need to invalidate all static expressions and $this at least, both for anonymous functions (which should be working except for use variable related expressions like this issue) and arrow functions (not invalidated now).
Not sure if there are other expressions that should be invalidated for delayed uses which are not static.
Bug report
PHPStan cannot be certain of class field types inside a closure, regardless of whether they were initialized outside of the closure.
Code snippet that reproduces the problem
https://phpstan.org/r/f9c6e122-a753-4fdf-b729-a5523443e71d
Expected output
No error should be reported. By the time the closure is invoked, the array may contain something.
Did PHPStan help you today? Did it make you happy in any way?
It's cool to see all the new stuff brought by 1.9
The text was updated successfully, but these errors were encountered: