title: Let an object loop as array with a foreach() by extending ArrayObject
body: <p>So I have an object which contains a set of objects in a private data member. I can now loop it with a <code>for</code> loop by overriding the <code>count()</code> function of an <code>ArrayObject</code> and <code>offsetGet($index)</code>, but I also want to loop it within a <code>foreach</code> loop. </p>
  
  <p>What functions do I need to minimally extend to add this functionality?</p>