PHP, for all its warts, is pretty good on this count. There\'s no difference between an array and a hash (maybe I\'m naive, but this seems obviously right to me), and to ite
Use each_with_index when you need both.
ary.each_with_index { |val, idx| # ...