-
-
Notifications
You must be signed in to change notification settings - Fork 946
Closed
Description
Bug report
Hi! I think I've found some inconsistencies in handling string array keys and the implicit cast.
Code snippet that reproduces the problem
https://phpstan.org/r/61624d33-5c41-43bf-a44f-357ef10575b5
Expected output
Some of my thoughts:
stringshould be considered asint|string- Maybe there should be some enforcements asking for a non-numeric string.
numeric-stringshould not be consideredint, butint|stringtoo. Maybe some more specific types (int-string|float-string/numeric-string-int|numeric-string-float/numeric-string<int|float>?) would help but I don't know if it would be worth.- Edit: even a
numeric-string<int>would still not be casted tointanyway, if it starts with0
Did PHPStan help you today? Did it make you happy in any way?
Oh boy do I love it
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels