But what's your point? In theory, it could, but in practice, it doesn't.
My answer to Roy answers this as well.
keys and values are meant to return their values in no predictable order.
No, it's not a feature, it's a side-effect. It would be needlessly costly to return them sorted. Why is it needless? Because people would still want custom sorting of the keys. (With arrays, they want custom sorting of the values.)
In reply to Re^4: What makes an array sorted and a hash unsorted?
by ikegami
in thread What makes an array sorted and a hash unsorted?
by ikegami
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |