-
-
Notifications
You must be signed in to change notification settings - Fork 942
Closed
phpstan/phpstan-src
#3950Labels
Description
Bug report
Hello,
I've came across this problem - see snippet where the class property is not recognized to be set in the body of a callback. On the other hand if I use an accessor (see snippet it is ok even if I don't set a different value than false.
Code snippet that reproduces the problem
- Example 1 - https://phpstan.org/r/ced3feef-be36-4177-8b90-3bdf13fa60fa
- Example 2 - https://phpstan.org/r/b3b7a7fd-5cd3-4552-b01b-2fb335aa825f
Expected output
So in the first example it should be ok, since the value is changed inside a closure and in the second example it should be actually always false since it is only set once to false.
Just to be clear - the first problem is what I think is a bug. The second is just a thing I noticed, which migth be useful but I don't think it is a bug.
Thanks
Reactions are currently unavailable