News for hackers. Stuff that matters.
Re:How PHP's foreach works by stormbrew on Thursday February 28, 2013 @03:08AM (#5297661)
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.

Re:How PHP's foreach works by jeltz on Thursday February 28, 2013 @07:29AM (#5298361)
Ruby 1.9 hash tables are also ordered by insertion order.