1--TEST--
2SPL: DualIterator
3--SKIPIF--
4<?php if (!extension_loaded("spl") || !extension_loaded("reflection")) print "skip"; ?>
5--FILE--
6<?php
7
8function spl_examples_autoload($classname)
9{
10	include(dirname(__FILE__) . '/../' . strtolower($classname) . '.inc');
11}
12
13spl_autoload_register('spl_examples_autoload');
14
15function test($a, $b, $identical = false)
16{
17	var_dump(DualIterator::compareIterators(
18					new RecursiveArrayIterator($a),
19					new RecursiveArrayIterator($b),
20					$identical));
21}
22
23test(array(1,2,3), array(1,2,3));
24test(array(1,2,3), array(1,2));
25test(array(1,array(21,22),3), array(1,array(21,22),3));
26test(array(1,array(21,22),3), array(1,array(21,22,23),3));
27test(array(1,array(21,22),3), array(1,array(21,22,3)));
28test(array(1,array(21,22),3), array(1,array(21),array(22),3));
29test(array(1,2,3), array(1,"2",3), false);
30test(array(1,2,3), array(1,"2",3), true);
31test(array(1,array(21,22),3), array(1,array(21,"22"),3), false);
32test(array(1,array(21,22),3), array(1,array(21,"22"),3), true);
33
34?>
35===DONE===
36<?php exit(0); ?>
37--EXPECT--
38bool(true)
39bool(false)
40bool(true)
41bool(false)
42bool(false)
43bool(false)
44bool(true)
45bool(false)
46bool(true)
47bool(false)
48===DONE===
49