xref: /PHP-5.5/ext/spl/tests/spl_001.phpt (revision 610c7fbe)
1--TEST--
2SPL: iterator_to_array() and iterator_count()
3--FILE--
4<?php
5
6$it = new ArrayObject(array("x"=>1, 1=>2, 3=>3, 4, "1"=>5));
7
8$ar = iterator_to_array($it);
9
10var_dump(iterator_count($it));
11
12print_r($ar);
13
14foreach($ar as $v)
15{
16	var_dump($v);
17}
18
19?>
20===DONE===
21--EXPECT--
22int(4)
23Array
24(
25    [x] => 1
26    [1] => 5
27    [3] => 3
28    [4] => 4
29)
30int(1)
31int(5)
32int(3)
33int(4)
34===DONE===
35