A bit of experimentation shows phps own functions don't persist this fubarity.
function noopa( $a ){ return $a; }
$arr = array_map('noopa', $arr );
$arr[0]; # no error!
This in effect, just creates a copy of the array, and the fix occurs during the copy.
Ultimately, its a design failure across the board, try using array_merge in the way you think it works on an array with mixed numeric and string keys?
All numbered elements get copied and some get re-numbered, even if some merely happen to be string-encapsulated-numbers, and as a result, there are dozens of homebrew implementations of array_merge just to solve this problem.
Back when php tried to make a clone of perl and failed, they didn't grasp the concept of arrays and hashes being distinct concepts, an instead globbed them together into one universal umbrella. Good going!.
For their next trick, they manage to break namespace delimiters because of some technical problem that no other language has for some reason encountered.