Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.



Ruby 1.9 hash tables are also ordered by insertion order.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: