-
-
Notifications
You must be signed in to change notification settings - Fork 946
Closed
phpstan/phpstan-src
#4787Description
Bug report
In attached example, the first error in the associate function started happening only in quite recent versions of phpstan and worked fine until then.
The issue here is that even phpstan sees the $key variable as int, for some reason it's interpreted as int|string when passed as array key in the associate function
Code snippet that reproduces the problem
https://phpstan.org/r/617a52bd-892c-4ef5-8b98-11713751784a
Expected output
The type of array key should be int as well
Did PHPStan help you today? Did it make you happy in any way?
No response
Reactions are currently unavailable