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 ***
31array(1) {
32  [0]=>
33  array(4) {
34    [0]=>
35    int(1)
36    [1]=>
37    int(2)
38    [2]=>
39    int(3)
40    [3]=>
41    int(1)
42  }
43}
44Done
45