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
39array(1) {
40  [0]=>
41  array(4) {
42    [0]=>
43    int(1)
44    [1]=>
45    int(2)
46    [2]=>
47    int(3)
48    [3]=>
49    int(1)
50  }
51}
52Done
53