$iterator = new ArrayIterator([1, 2]); array_walk($iterator, function($item) {echo $item . PHP_EOL;});
This piece of php code outputs the items (1 and 2