diff options
author | Marcus Boerger <helly@php.net> | 2006-05-18 22:52:04 +0000 |
---|---|---|
committer | Marcus Boerger <helly@php.net> | 2006-05-18 22:52:04 +0000 |
commit | 55041d6f3d17a8e505e7cdcfdb1256fcc31a0cb7 (patch) | |
tree | b25aae08f1248b9ef616731d32626aafecc5a483 | |
parent | 69079a7537c45a87a6dc262c3a50f32cfc297dd8 (diff) | |
download | php-git-55041d6f3d17a8e505e7cdcfdb1256fcc31a0cb7.tar.gz |
- MFH Add new test
-rwxr-xr-x | ext/spl/tests/iterator_040.phpt | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/ext/spl/tests/iterator_040.phpt b/ext/spl/tests/iterator_040.phpt new file mode 100755 index 0000000000..a162cac68f --- /dev/null +++ b/ext/spl/tests/iterator_040.phpt @@ -0,0 +1,49 @@ +--TEST-- +SPL: RecursiveFilterIterator +--SKIPIF-- +<?php if (!extension_loaded("spl")) print "skip"; ?> +--FILE-- +<?php + +class MyRecursiveFilterIterator extends RecursiveFilterIterator +{ + function accept() + { + return true; + } +} + +$ar = array(1, array(21, 22), 3); +$it = new RecursiveArrayIterator($ar); +$it = new MyRecursiveFilterIterator($it); +$it = new RecursiveIteratorIterator($it); + +foreach($it as $k => $v) +{ + echo "===\n"; + var_dump($it->getDepth()); + var_dump($k); + var_dump($v); +} + +?> +===DONE=== +<?php exit(0); ?> +--EXPECT-- +=== +int(0) +int(0) +int(1) +=== +int(1) +int(0) +int(21) +=== +int(1) +int(1) +int(22) +=== +int(0) +int(2) +int(3) +===DONE=== |