Is there an SPL Reverse array iterator in PHP? And if not, what would be the best way to achieve it?
I could simply do
$array = array_reverse($array)
This could be a more performant way since it doesnt construct a new array. It also handles empty arrays well.
$item = end($items); while($item) { ...do stuff... $item = prev($items); }