]> granicus.if.org Git - php/commitdiff
Fix tests, add NEWS entry.
authorAndrei Zmievski <andrei@php.net>
Fri, 12 Dec 2008 23:59:48 +0000 (23:59 +0000)
committerAndrei Zmievski <andrei@php.net>
Fri, 12 Dec 2008 23:59:48 +0000 (23:59 +0000)
NEWS
ext/standard/tests/array/array_unique_error.phpt
ext/standard/tests/array/array_unique_variation2.phpt
ext/standard/tests/array/array_unique_variation6.phpt
ext/standard/tests/array/array_unique_variation8.phpt

diff --git a/NEWS b/NEWS
index 5c009ff014008f59b1d9fdabfce36d032836a00b..d1cb95e460470f315d09c893cd52b3e763ffa3bd 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,8 @@
 PHP                                                                        NEWS
 |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
 ?? ??? 200?, PHP 5.3.0 Alpha 4
+- Added optional sorting type flag parameter to array_unique(), default is
+  SORT_REGULAR. (Andrei)
 - Changed opendir(), dir() and scandir() to use default context when no context
   argument is passed. (Sara)
 - Changed open_basedir to allow tightening in runtime contexts. (Sara)
index 05c10ac7650ff77e89b1f73e4cd220d86518895a..9da3dfcad6b4d4e27ae548b94000dbf917dd148d 100644 (file)
@@ -17,7 +17,7 @@ var_dump( array_unique() );
 echo "\n-- Testing array_unique() function with more than expected no. of arguments --\n";
 $input = array(1, 2);
 $extra_arg = 10;
-var_dump( array_unique($input, $extra_arg) );
+var_dump( array_unique($input, SORT_NUMERIC, $extra_arg) );
 
 echo "Done";
 ?>
@@ -26,11 +26,11 @@ echo "Done";
 
 -- Testing array_unique() function with zero arguments --
 
-Warning: array_unique() expects exactly 1 parameter, 0 given in %s on line %d
+Warning: array_unique() expects at least 1 parameter, 0 given in %s on line %d
 NULL
 
 -- Testing array_unique() function with more than expected no. of arguments --
 
-Warning: array_unique() expects exactly 1 parameter, 2 given in %s on line %d
+Warning: array_unique() expects at most 2 parameters, 3 given in %s on line %d
 NULL
 Done
index b821861bb35261046a45459eca2dfc22db8a3b44..df53c76a559d7acd9fa9f3ee01983683a60c47f2 100644 (file)
@@ -74,7 +74,7 @@ $inputs = array (
 $iterator = 1;
 foreach($inputs as $input) {
   echo "-- Iteration $iterator --\n";
-  var_dump( array_unique($input) );
+  var_dump( array_unique($input, SORT_STRING) );
   $iterator++;
 }
   
index fd8b226fabfaff520d74a1c91dada6803b3f5e2f..15a46518b7c6f4027fb21172523ef3335475b3ee 100644 (file)
@@ -29,7 +29,7 @@ $input = array(
   5 => $value4
 );
 
-var_dump( array_unique($input) );
+var_dump( array_unique($input, SORT_STRING) );
 
 echo "Done";
 ?>
index ae6e8bb5c157d0b5bd25c5606fa59b5a42acebb7..6cf343221f5b26a6c881013194f751552618751d 100644 (file)
@@ -22,7 +22,7 @@ $input = array(
   array(1, 2, 3, 1)
 );
 
-var_dump( array_unique($input) );
+var_dump( array_unique($input, SORT_STRING) );
 
 echo "Done";
 ?>