1--TEST-- 2Test array_unique() function : usage variations - two dimensional arrays 3--FILE-- 4<?php 5/* Prototype : array array_unique(array $input) 6 * Description: Removes duplicate values from array 7 * Source code: ext/standard/array.c 8*/ 9 10/* 11 * Testing the functionality of array_unique() by passing 12 * two dimensional arrays for $input argument. 13*/ 14 15echo "*** Testing array_unique() : two dimensional array for \$input argument ***\n"; 16 17// initialize the 2-d array 18$input = array( 19 array(1, 2, 3, 1), 20 array("hello", "world", "str1" => "hello", "str2" => 'world'), 21 array(1 => "one", 2 => "two", "one", 'two'), 22 array(1, 2, 3, 1) 23); 24 25var_dump( array_unique($input, SORT_STRING) ); 26 27echo "Done"; 28?> 29--EXPECTF-- 30*** Testing array_unique() : two dimensional array for $input argument *** 31 32Notice: Array to string conversion in %sarray_unique_variation8.php on line %d 33 34Notice: Array to string conversion in %sarray_unique_variation8.php on line %d 35 36Notice: Array to string conversion in %sarray_unique_variation8.php on line %d 37 38Notice: Array to string conversion in %sarray_unique_variation8.php on line %d 39 40Notice: Array to string conversion in %sarray_unique_variation8.php on line %d 41 42Notice: Array to string conversion in %sarray_unique_variation8.php on line %d 43 44Notice: Array to string conversion in %sarray_unique_variation8.php on line %d 45 46Notice: Array to string conversion in %sarray_unique_variation8.php on line %d 47 48Notice: Array to string conversion in %sarray_unique_variation8.php on line %d 49 50Notice: Array to string conversion in %sarray_unique_variation8.php on line %d 51 52Notice: Array to string conversion in %sarray_unique_variation8.php on line %d 53 54Notice: Array to string conversion in %sarray_unique_variation8.php on line %d 55 56Notice: Array to string conversion in %sarray_unique_variation8.php on line %d 57 58Notice: Array to string conversion in %sarray_unique_variation8.php on line %d 59array(1) { 60 [0]=> 61 array(4) { 62 [0]=> 63 int(1) 64 [1]=> 65 int(2) 66 [2]=> 67 int(3) 68 [3]=> 69 int(1) 70 } 71} 72Done 73