diff options
author | Marcus Boerger <helly@php.net> | 2004-10-07 23:08:19 +0000 |
---|---|---|
committer | Marcus Boerger <helly@php.net> | 2004-10-07 23:08:19 +0000 |
commit | 6349f46e38643259e2de48a2df90c1d4ab7ab55b (patch) | |
tree | cc151a5ee4ccf098ca2b02d1057a3a5d97b0b643 /ext/spl/tests/spl_001.phpt | |
parent | 940c5b393d92f04fab49b59e605364f17372e7dc (diff) | |
download | php-git-6349f46e38643259e2de48a2df90c1d4ab7ab55b.tar.gz |
- Added iterator_to_array() and iterator_count()
Diffstat (limited to 'ext/spl/tests/spl_001.phpt')
-rwxr-xr-x | ext/spl/tests/spl_001.phpt | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/ext/spl/tests/spl_001.phpt b/ext/spl/tests/spl_001.phpt new file mode 100755 index 0000000000..e101272a84 --- /dev/null +++ b/ext/spl/tests/spl_001.phpt @@ -0,0 +1,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=== |