3 ms·
PHP silently transforming all string keys of a map to integers when they are all integer strings ("123", "456" etc.) is exactly one of the reasons I'll never ch
by pdimitar 6y ago
PHP silently transforming all string keys of a map to integers when they are all integer strings ("123", "456" etc.) is exactly one of the reasons I'll never choose a language that pulls the rug from below my feet and replaces it with parquet.
- limomium 6y agoIf you bother to read the manual [1], it explicitly states that this happens. Almost at the top of the page. Hardly "silent". [1] https://www.php.net/manual/en/language.types.array.php https://www.php.net/manual/en/language.types.array.php
- pdimitar 6y agoIt's not reasonable to expect such gotchas. It might have been a 20px red bold text on top of php.net and it would still be very not okay.