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.
If you bother to read the manual [1], it explicitly states that this happens. Almost at the top of the page. Hardly "silent".