Bug report
I ran into an issue using level 7 where I try to set a key of an array, and PHPStan reports an error because an unrelated key has a different type.
In the attached code snippet, I've defined a function that sets the number of legs on an animal. A nose class for each animal is also tracked. For some reason, PHPStan is showing an error related to the nose type when setting the number of legs for an animal.
In both cases, the type being set is an integer, and there's no way that I see for the nose value of one animal to pollute the other.
Code snippet that reproduces the problem
https://phpstan.org/r/ca628011-be99-435b-9490-2adbe26c5016
Expected output
No errors should be detected.
Did PHPStan help you today? Did it make you happy in any way?
PHPStan makes it easy to identify areas where types are not sufficiently defined, and using it in a CI pipeline allows us to enforce a minimum standard for code submissions. This makes future maintenance easier - we don't need to dig through a bunch of files just to understand what our data looks like. I appreciate you, PHPStan authors!