1--TEST--
2SPL: RecursiveIteratorIterator::getSubIterator() with explicit level parameter
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();
14$iterator->next();
15var_dump($iterator->getSubIterator(-1));
16var_dump($iterator->getSubIterator(0)->getArrayCopy());
17var_dump($iterator->getSubIterator(1)->getArrayCopy());
18var_dump($iterator->getSubIterator(2));
19?>
20--EXPECT--
21NULL
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}
35array(2) {
36  [0]=>
37  int(3)
38  [1]=>
39  int(4)
40}
41NULL
42