PHP implementation of the array directly with the hash table to achieve, I just want to say that the author is too clever, this article introduces the hash algorithm in PHP, the future of their own design framework will be very helpful. At the same time, the weak type of PHP design ingenious, it can be reference to the design! PHP is the best Web language in the World ~ ~ Not Black ~ ~
It is widely used in practice, such as a symbol table that compilers typically maintain to hold tags, and a hash table is also explicitly supported in many high-level languages. A hash table usually provides operations such as find (search), insert, Delete, and so on, in the worst case, the same as the performance of the list O (n). But usually not so bad, a reasonably designed hashing algorithm can effectively avoid such situations, usually the hash table of these operating time complexity is O (1). This is why it is beloved.
Methods for resolving hash conflicts PHP uses the link method, that is, the different keys are mapped to the same bucket or slot, and the list is used to save the value, if all the keys are mapped to the same slot, that is the worst case of the operation of the list of Complexity O (n). There is also a way to resolve conflicts is open addressing, that is, if the index of a bucket has values, go to the next bucket to index, and then check.
Original: http://www.nowamagic.net/librarys/veda/detail/1344
PHP Kernel Explorer: Hash table in PHP