1--TEST--
2SPL: RecursiveIteratorIterator::getSubIterator() returns different iterators depending on the current element
3--CREDITS--
4Matt Raines matt@raines.me.uk
5#testfest London 2009-05-09
6--FILE--
7<?php
8$sample_array = array(1, 2, array(3, 4));
9
10$iterator = new RecursiveIteratorIterator(new RecursiveArrayIterator($sample_array));
11
12$iterator->next();
13$iterator->next();
14var_dump(get_class($iterator->getSubIterator()));
15var_dump($iterator->getSubIterator()->getArrayCopy());
16$iterator->next();
17var_dump(get_class($iterator->getSubIterator()));
18var_dump($iterator->getSubIterator()->getArrayCopy());
19?>
20--EXPECTF--
21string(22) "RecursiveArrayIterator"
22array(3) {
23  [0]=>
24  int(1)
25  [1]=>
26  int(2)
27  [2]=>
28  array(2) {
29    [0]=>
30    int(3)
31    [1]=>
32    int(4)
33  }
34}
35string(22) "RecursiveArrayIterator"
36array(2) {
37  [0]=>
38  int(3)
39  [1]=>
40  int(4)
41}
42