You can easily realise that ArrayObject can use various functions as they are in ArrayIterator to iterate an object-as-a-array. However, you need to "activate" these function (rewind, valid, next and so on...) by using getIterator() first. Actually this function inherits from Iterator Aggregate interface.
Take a look at the following basic example. The results are the same:
<?php
$array = [1, 2, 3, 4];
$a = new ArrayObject($array);
$b = new ArrayIterator($array);
$iterator = $a->getIterator();
for($iterator->rewind(); $iterator->valid(); $iterator->next()){
echo $iterator->current()*2;
}
for($b->rewind(); $b->valid(); $b->next()){
echo $b->current()*2;
}