tony2001 Thu Jun 1 13:17:36 2006 UTC Modified files: (Branch: PHP_5_2) /php-src/ext/standard/tests/array 007.phpt array_intersect_1.phpt Log: fix tests
http://cvs.php.net/viewcvs.cgi/php-src/ext/standard/tests/array/007.phpt?r1=1.9.4.1&r2=1.9.4.1.2.1&diff_format=u Index: php-src/ext/standard/tests/array/007.phpt diff -u php-src/ext/standard/tests/array/007.phpt:1.9.4.1 php-src/ext/standard/tests/array/007.phpt:1.9.4.1.2.1 --- php-src/ext/standard/tests/array/007.phpt:1.9.4.1 Mon Oct 17 14:38:10 2005 +++ php-src/ext/standard/tests/array/007.phpt Thu Jun 1 13:17:36 2006 @@ -61,6 +61,10 @@ if ($a->priv_member === $b->priv_member) return 0; return ($a->priv_member > $b->priv_member)? 1:-1; } + + function __toString() { + return "Object"; + } } function comp_func($a, $b) { @@ -309,21 +313,21 @@ var_dump(array_udiff_uassoc($a, $b, "comp_func_cr", "comp_func")); array(3) { ["0.1"]=> - object(cr)#1 (2) { + object(cr)#%d (2) { ["priv_member:private"]=> int(9) ["public_member"]=> int(9) } ["0.5"]=> - object(cr)#2 (2) { + object(cr)#%d (2) { ["priv_member:private"]=> int(12) ["public_member"]=> int(12) } [0]=> - object(cr)#3 (2) { + object(cr)#%d (2) { ["priv_member:private"]=> int(23) ["public_member"]=> @@ -387,21 +391,21 @@ var_dump(array_udiff_uassoc($a, $b, array("cr", "comp_func_cr"), "comp_func")); array(3) { ["0.1"]=> - object(cr)#1 (2) { + object(cr)#%d (2) { ["priv_member:private"]=> int(9) ["public_member"]=> int(9) } ["0.5"]=> - object(cr)#2 (2) { + object(cr)#%d (2) { ["priv_member:private"]=> int(12) ["public_member"]=> int(12) } [0]=> - object(cr)#3 (2) { + object(cr)#%d (2) { ["priv_member:private"]=> int(23) ["public_member"]=> @@ -463,42 +467,14 @@ )), ); var_dump(array_diff_assoc($a, $b)); -array(5) { +array(1) { ["0.1"]=> - object(cr)#1 (2) { + object(cr)#%d (2) { ["priv_member:private"]=> int(9) ["public_member"]=> int(9) } - ["0.5"]=> - object(cr)#2 (2) { - ["priv_member:private"]=> - int(12) - ["public_member"]=> - int(12) - } - [0]=> - object(cr)#3 (2) { - ["priv_member:private"]=> - int(23) - ["public_member"]=> - int(23) - } - [1]=> - object(cr)#4 (2) { - ["priv_member:private"]=> - int(4) - ["public_member"]=> - int(4) - } - [2]=> - object(cr)#5 (2) { - ["priv_member:private"]=> - int(-15) - ["public_member"]=> - int(-15) - } } $a=array ( '0.1' => @@ -557,14 +533,14 @@ var_dump(array_udiff($a, $b, "comp_func_cr")); array(2) { ["0.5"]=> - object(cr)#2 (2) { + object(cr)#%d (2) { ["priv_member:private"]=> int(12) ["public_member"]=> int(12) } [0]=> - object(cr)#3 (2) { + object(cr)#%d (2) { ["priv_member:private"]=> int(23) ["public_member"]=> @@ -628,21 +604,21 @@ var_dump(array_udiff_assoc($a, $b, "comp_func_cr")); array(3) { ["0.1"]=> - object(cr)#1 (2) { + object(cr)#%d (2) { ["priv_member:private"]=> int(9) ["public_member"]=> int(9) } ["0.5"]=> - object(cr)#2 (2) { + object(cr)#%d (2) { ["priv_member:private"]=> int(12) ["public_member"]=> int(12) } [0]=> - object(cr)#3 (2) { + object(cr)#%d (2) { ["priv_member:private"]=> int(23) ["public_member"]=> http://cvs.php.net/viewcvs.cgi/php-src/ext/standard/tests/array/array_intersect_1.phpt?r1=1.5.4.1&r2=1.5.4.1.2.1&diff_format=u Index: php-src/ext/standard/tests/array/array_intersect_1.phpt diff -u php-src/ext/standard/tests/array/array_intersect_1.phpt:1.5.4.1 php-src/ext/standard/tests/array/array_intersect_1.phpt:1.5.4.1.2.1 --- php-src/ext/standard/tests/array/array_intersect_1.phpt:1.5.4.1 Mon Oct 17 14:38:11 2005 +++ php-src/ext/standard/tests/array/array_intersect_1.phpt Thu Jun 1 13:17:36 2006 @@ -2,7 +2,7 @@ Test of the *intersect* bunch of functions (both assoc and non-assoc) --FILE-- <?php -error_reporting(E_ALL); +error_reporting(E_ALL|E_STRICT); class cr { private $priv_member; public $public_member; @@ -14,6 +14,10 @@ if ($a->priv_member === $b->priv_member) return 0; return ($a->priv_member > $b->priv_member)? 1:-1; } + + function __toString() { + return "Object"; + } } function comp_func($a, $b) { @@ -35,7 +39,7 @@ echo '$a='.var_export($a,TRUE).";\n"; echo '$b='.var_export($b,TRUE).";\n"; echo 'var_dump(array_intersect($a, $b);'."\n"; -var_dump(@array_intersect($a, $b)); +var_dump(array_intersect($a, $b)); echo "end ------------ array_intersect() ----------------------------\n"; /* array_uintersect() */ @@ -51,7 +55,7 @@ echo '$a='.var_export($a,TRUE).";\n"; echo '$b='.var_export($b,TRUE).";\n"; echo 'var_dump(array_intersect_assoc($a, $b));'."\n"; -var_dump(@array_intersect_assoc($a, $b)); +var_dump(array_intersect_assoc($a, $b)); echo "end ------------ array_intersect_assoc() ----------------------\n"; /* array_uintersect_assoc() */ @@ -67,7 +71,7 @@ echo '$a='.var_export($a,TRUE).";\n"; echo '$b='.var_export($b,TRUE).";\n"; echo 'var_dump(array_intersect_uassoc($a, $b, "comp_func"));'."\n"; -var_dump(@array_intersect_uassoc($a, $b, "comp_func")); +var_dump(array_intersect_uassoc($a, $b, "comp_func")); echo "end ------------ array_intersect_uassoc() ---------------------\n"; /* array_uintersect_uassoc() - with ordinary function */ @@ -143,7 +147,42 @@ )), ); var_dump(array_intersect($a, $b); -array(0) { +array(5) { + ["0.1"]=> + object(cr)#%d (2) { + ["priv_member:private"]=> + int(9) + ["public_member"]=> + int(9) + } + ["0.5"]=> + object(cr)#%d (2) { + ["priv_member:private"]=> + int(12) + ["public_member"]=> + int(12) + } + [0]=> + object(cr)#%d (2) { + ["priv_member:private"]=> + int(23) + ["public_member"]=> + int(23) + } + [1]=> + object(cr)#%d (2) { + ["priv_member:private"]=> + int(4) + ["public_member"]=> + int(4) + } + [2]=> + object(cr)#%d (2) { + ["priv_member:private"]=> + int(-15) + ["public_member"]=> + int(-15) + } } end ------------ array_intersect() ---------------------------- begin ------------ array_uintersect() --------------------------- @@ -204,21 +243,21 @@ var_dump(array_uintersect($a, $b, "comp_func_cr")); array(3) { ["0.1"]=> - object(cr)#1 (2) { + object(cr)#%d (2) { ["priv_member:private"]=> int(9) ["public_member"]=> int(9) } [1]=> - object(cr)#4 (2) { + object(cr)#%d (2) { ["priv_member:private"]=> int(4) ["public_member"]=> int(4) } [2]=> - object(cr)#5 (2) { + object(cr)#%d (2) { ["priv_member:private"]=> int(-15) ["public_member"]=> @@ -282,7 +321,35 @@ )), ); var_dump(array_intersect_assoc($a, $b)); -array(0) { +array(4) { + ["0.5"]=> + object(cr)#%d (2) { + ["priv_member:private"]=> + int(12) + ["public_member"]=> + int(12) + } + [0]=> + object(cr)#%d (2) { + ["priv_member:private"]=> + int(23) + ["public_member"]=> + int(23) + } + [1]=> + object(cr)#%d (2) { + ["priv_member:private"]=> + int(4) + ["public_member"]=> + int(4) + } + [2]=> + object(cr)#%d (2) { + ["priv_member:private"]=> + int(-15) + ["public_member"]=> + int(-15) + } } end ------------ array_intersect_assoc() ---------------------- begin ------------ array_uintersect_assoc() --------------------- @@ -343,14 +410,14 @@ var_dump(array_uintersect_assoc($a, $b, "comp_func_cr")); array(2) { [1]=> - object(cr)#4 (2) { + object(cr)#%d (2) { ["priv_member:private"]=> int(4) ["public_member"]=> int(4) } [2]=> - object(cr)#5 (2) { + object(cr)#%d (2) { ["priv_member:private"]=> int(-15) ["public_member"]=> @@ -414,7 +481,35 @@ )), ); var_dump(array_intersect_uassoc($a, $b, "comp_func")); -array(0) { +array(4) { + ["0.5"]=> + object(cr)#%d (2) { + ["priv_member:private"]=> + int(12) + ["public_member"]=> + int(12) + } + [0]=> + object(cr)#%d (2) { + ["priv_member:private"]=> + int(23) + ["public_member"]=> + int(23) + } + [1]=> + object(cr)#%d (2) { + ["priv_member:private"]=> + int(4) + ["public_member"]=> + int(4) + } + [2]=> + object(cr)#%d (2) { + ["priv_member:private"]=> + int(-15) + ["public_member"]=> + int(-15) + } } end ------------ array_intersect_uassoc() --------------------- begin ------------ array_uintersect_uassoc() with ordinary func - @@ -475,14 +570,14 @@ var_dump(array_uintersect_uassoc($a, $b, "comp_func_cr", "comp_func")); array(2) { [1]=> - object(cr)#4 (2) { + object(cr)#%d (2) { ["priv_member:private"]=> int(4) ["public_member"]=> int(4) } [2]=> - object(cr)#5 (2) { + object(cr)#%d (2) { ["priv_member:private"]=> int(-15) ["public_member"]=> @@ -548,14 +643,14 @@ var_dump(array_uintersect_uassoc($a, $b, array("cr", "comp_func_cr"), "comp_func")); array(2) { [1]=> - object(cr)#4 (2) { + object(cr)#%d (2) { ["priv_member:private"]=> int(4) ["public_member"]=> int(4) } [2]=> - object(cr)#5 (2) { + object(cr)#%d (2) { ["priv_member:private"]=> int(-15) ["public_member"]=>
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php