-
-
Notifications
You must be signed in to change notification settings - Fork 942
Closed
Labels
Milestone
Description
Bug report
Hello,
I've ran into an issue in some legacy project after upgrading to version 2.1.25.
Basically there are two maps and one of them is used dynamically. PHPStan seems to make a union type out of it in the background (judging by the error message).
Although array_key_exists returns true, it still reports an error, that the key might not exist in one of the two maps.
Code snippet that reproduces the problem
https://phpstan.org/r/4c05958a-eefb-4335-b210-8680b9edfae1
Expected output
As it is a false positive, no error should be reported.
Did PHPStan help you today? Did it make you happy in any way?
Thanks for all the hard work! PHPStan helped us a lot in finding bugs early especially when working with legacy code.
Reactions are currently unavailable