Php, Spl, ArrayIterator
问题 I am trying to understand piece of code: $array = array('koala', 'kangaroo', 'wombat', 'wallaby', 'emu', 'kiwi', 'kookaburra', 'platypus'); $object = new ArrayIterator($array); foreach($object as $key=>$value) { if($object->offSetGet($key) === 'kiwi') { $object->offSetUnset($key); } echo $key.' - '.$value."<br />"; } What i was trying to understand is why offSetUnset is taking the pointer to the second element at the array and not to the first one, My theory is the following sequence of