blob: 8a2df5267253faeb19275cf778b8ede803ac8a73 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
--TEST--
Test array_unique() function : usage variations - array with duplicate keys
--FILE--
<?php
/*
* Testing the functionality of array_unique() by passing
* array having duplicate keys as values.
*/
echo "*** Testing array_unique() : array with duplicate keys for \$input argument ***\n";
// initialize the array having duplicate keys
$input = array( 1 => "one", 2 => "two", 2 => "2", 3 => "three", 1 => "1", "1", "2");
var_dump( array_unique($input) );
echo "Done";
?>
--EXPECT--
*** Testing array_unique() : array with duplicate keys for $input argument ***
array(3) {
[1]=>
string(1) "1"
[2]=>
string(1) "2"
[3]=>
string(5) "three"
}
Done
|