blob: 98712fba3fab2c28ede49a0be2eaafdd86a00b85 (
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
29
30
31
32
33
|
--TEST--
Test array_unique() function : usage variations - binary safe checking
--FILE--
<?php
/* Prototype : array array_unique(array $input)
* Description: Removes duplicate values from array
* Source code: ext/standard/array.c
*/
/*
* Testing the functionality of array_unique() by passing an array having binary values.
*/
echo "*** Testing array_unique() : array with binary data for \$input argument ***\n";
// array with binary values
$input = array( b"1", b"hello", "world", "str1" => "hello", "str2" => "world");
var_dump( array_unique($input) );
echo "Done";
?>
--EXPECT--
*** Testing array_unique() : array with binary data for $input argument ***
array(3) {
[0]=>
string(1) "1"
[1]=>
string(5) "hello"
[2]=>
string(5) "world"
}
Done
|