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