1 <?php
2 $array = [
3 "one" => [0, 1, 2, 3],
4 "two" => [0, 2, 4, 6],
5 "three" => [0, 3, 6, 9],
6 ];
7
8 $iterator = new Spl\ForwardArrayIterator($array);
9 foreach ($iterator as $key => $current) {
10 echo "$key\n";
11 }
12 /* outputs:
13 one
14 two
15 three
16 */