Keys Are Integers Whenever Possible

no-email (Damien Seguy), Damien Seguy
Fri, 07 Oct 2022 00:00:00 +0000

Array keys are only strings or integers: the later has priority. So, when storing a string that can be converted to an integer, PHP does the conversion automatically.
In the case displayed, the keys are French zip codes, which might start with a leading ``0``. But PHP converts it into integer, and drops that leading ``0``. The value is still correctly indexed, but now, the string representation has changed.