1
0
mirror of https://github.com/php/php-src.git synced 2026-04-24 16:38:25 +02:00
Files
archived-php-src/ext/spl/tests/dualiterator_001.phpt
T
Fabien Villepinte a555cc0b3d Clean DONE tags from tests
Remove most of the `===DONE===` tags and its variations.
Keep `===DONE===` if the test output otherwise becomes empty.

Closes GH-4872.
2019-11-07 21:31:47 +01:00

44 lines
1.0 KiB
PHP

--TEST--
SPL: DualIterator
--FILE--
<?php
function spl_examples_autoload($classname)
{
include(__DIR__ . '/' . strtolower($classname) . '.inc');
}
spl_autoload_register('spl_examples_autoload');
function test($a, $b, $identical = false)
{
var_dump(DualIterator::compareIterators(
new RecursiveArrayIterator($a),
new RecursiveArrayIterator($b),
$identical));
}
test(array(1,2,3), array(1,2,3));
test(array(1,2,3), array(1,2));
test(array(1,array(21,22),3), array(1,array(21,22),3));
test(array(1,array(21,22),3), array(1,array(21,22,23),3));
test(array(1,array(21,22),3), array(1,array(21,22,3)));
test(array(1,array(21,22),3), array(1,array(21),array(22),3));
test(array(1,2,3), array(1,"2",3), false);
test(array(1,2,3), array(1,"2",3), true);
test(array(1,array(21,22),3), array(1,array(21,"22"),3), false);
test(array(1,array(21,22),3), array(1,array(21,"22"),3), true);
?>
--EXPECT--
bool(true)
bool(false)
bool(true)
bool(false)
bool(false)
bool(false)
bool(true)
bool(false)
bool(true)
bool(false)