title: Treat a PHP class that implements Iterator as an array
body: <p>If I have a class that implements the <code>Iterator</code> interface, I can manually control how iteration in a <code>foreach</code> loop. But are there other ways in which I could make my object behave like an array?</p>
  
  <p>For instance, let's say I have a class <code>Guestbook</code> which implements <code>Iterator</code>, so that I can iterate <code>foreach (new Guestbook() as $entry)</code>. But what if I want to, say, reverse the order?</p>
  
  <p><code>foreach (array_reverse(new Guestbook()) as $entry)</code> definitely won't work, because <code>array_reverse</code> will only accept an array.</p>
  
  <p>I guess what I'm asking is, can I use <code>Iterator</code> for more than just <code>foreach</code> loops?</p>
  
  <p>Thanks.</p>