1--TEST--
2Test array_unique() function : usage variations - array with duplicate keys
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 * array having duplicate keys as values.
13*/
14
15echo "*** Testing array_unique() : array with duplicate keys for \$input argument ***\n";
16
17// initialize the array having duplicate keys
18$input = array( 1 => "one", 2 => "two", 2 => "2", 3 => "three", 1 => "1", "1", "2");
19var_dump( array_unique($input) );
20
21echo "Done";
22?>
23--EXPECT--
24*** Testing array_unique() : array with duplicate keys for $input argument ***
25array(3) {
26  [1]=>
27  string(1) "1"
28  [2]=>
29  string(1) "2"
30  [3]=>
31  string(5) "three"
32}
33Done
34