Say you have an associative array of about 10,000 elements in size. Is this generally viewed as too BIG of an array and thus undesirable from the standpoint of fast webpage serving? What I want to do is this (And I want to do it fast without a noticable delay):
//assume $theArray has 10,000 elements
echo $theArray["product_4563"];
No, the “arrays” in PHP are actually Maps, or dictionaries.
The key is mapped to the value with a Hash table, so it’s an O(1) access anyway.
Most languages support arrays in a way that the insert, remove, access or in O(1) like in a regular array.
Or else it wouldn’t really be an array, and thus not named “Array”.