php.net/manual/en/language.types.array.php "The indexed and associative array types are the same type in PHP, which can both contain integer and string indices." I may be wrong, but doesn't that mean it should already contain a numeric index?
No, it's saying you can use both numeric and string indicies, not that you can access them using one or the other. Remember a key is a unique value identifier, and if you're allowed to use a number or a string you cannot access them using their numeric position in the array, take the following array:
$arr = Array(
[mgm19] => Array(
[override] => 1
),
[0] => Array(
[override] => 1
)
);
We're allowed to have mixed datatypes as a key, and the reason you cannot access [mgm19]
as [0]
is because that's not its key.
I hope that made sense :P