4 ms·
Most hash tables have a semi-random order dictated by the hash algorithm in combination with the bucket count. PHP Arrays are ordered by insertion order (each s
by stormbrew 14y ago
Most hash tables have a semi-random order dictated by the hash algorithm in combination with the bucket count. PHP Arrays are ordered by insertion order (each slot in the hash table has a next pointer, the last of which is appended to on insertion).
The order may be unusual or even non-obvious, but it is predictable.
- jeltz 14y agoRuby 1.9 hash tables are also ordered by insertion order.