xref: /PHP-7.0/ext/spl/tests/spl_006.phpt (revision 610c7fbe)
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===DONE===
16--EXPECT--
17array(2) {
18  [0]=>
19  int(2)
20  [1]=>
21  int(3)
22}
23array(4) {
24  [0]=>
25  int(1)
26  [1]=>
27  int(2)
28  [2]=>
29  int(2)
30  [3]=>
31  int(3)
32}
33array(2) {
34  [0]=>
35  int(2)
36  [1]=>
37  int(3)
38}
39===DONE===
40