xref: /php-src/ext/spl/tests/spl_006.phpt (revision a555cc0b)
1--TEST--
2SPL: iterator_to_array() without keys
3--FILE--
4<?php
5
6$it = new AppendIterator();
7$it->append(new ArrayIterator(array(1,2)));
8$it->append(new ArrayIterator(array(2,3)));
9
10var_dump(iterator_to_array($it));
11var_dump(iterator_to_array($it, false));
12var_dump(iterator_to_array($it, true));
13
14?>
15--EXPECT--
16array(2) {
17  [0]=>
18  int(2)
19  [1]=>
20  int(3)
21}
22array(4) {
23  [0]=>
24  int(1)
25  [1]=>
26  int(2)
27  [2]=>
28  int(2)
29  [3]=>
30  int(3)
31}
32array(2) {
33  [0]=>
34  int(2)
35  [1]=>
36  int(3)
37}
38