summaryrefslogtreecommitdiff
path: root/ext/spl/tests/spl_001.phpt
blob: e101272a84dad9e8e7945330e6503e41d08d96b8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
--TEST--
SPL: iterator_to_array() and iterator_count()
--FILE--
<?php

$it = new ArrayObject(array("x"=>1, 1=>2, 3=>3, 4, "1"=>5));

$ar = iterator_to_array($it);

var_dump(iterator_count($it));

print_r($ar);

foreach($ar as $v)
{
	var_dump($v);
}

?>
===DONE===
--EXPECT--
int(4)
Array
(
    [x] => 1
    [1] => 5
    [3] => 3
    [4] => 4
)
int(1)
int(5)
int(3)
int(4)
===DONE===