-
-
Notifications
You must be signed in to change notification settings - Fork 943
Closed
Labels
Description
Bug report
Phpstan is super smart about combined strings, and that dynamic string as a property name, see 👍 in example. But then when I ask it what the type is, Phpstan goes with mixed? Come ooon, you know the property, you know if it exists, you know the possible types!
Code snippet that reproduces the problem
https://phpstan.org/r/5da6f64c-15d7-44bd-82a8-3cf3ec370130
Expected output
That should be a union type. In this example not even, because they're all int. Pretty smart, but it could be a little smarter. Maybe it's too expensive to do multiple property type checks? No idea what this would entail, but I feel it could be smarter.
Did PHPStan help you today? Did it make you happy in any way?
Stan keeps surprising me with its smartness, I love it. "Could it understand this?" Yep! (Except sometimes ;))
Reactions are currently unavailable