-
Notifications
You must be signed in to change notification settings - Fork 8k
Closed as not planned
Description
Description
Currently, PHP will automatically convert some int-like strings to int when used as array keys.
-
this can lead to unexpected behavior, depending on the array keys used (since some will get typecast, while others won't, even though both would pass
is_numeric()) -
this adds overhead for type juggling on all array operations, since values need to be type juggled
This has been discussed in #9029
I think it would make sense to create an RFC to stop doing this with PHP 8.5 (I don't have permission, otherwise I would have done that already)
Since most people are unaware that this happens in the first place, the impact would probably not be too big, but it is definitely a breaking change.
AlexMordred