1--TEST--
2Test array_diff() function : usage variations - binary safe checking
3--FILE--
4<?php
5/* Prototype  : array array_diff(array $arr1, array $arr2 [, array ...])
6 * Description: Returns the entries of $arr1 that have values which are
7 * not present in any of the others arguments.
8 * Source code: ext/standard/array.c
9 */
10
11/*
12 * Test behaviour of array_diff() function with binary input
13 */
14
15echo "*** Testing array_diff() : usage variations ***\n";
16
17
18$array1 = array( b"1",
19                 b"hello",
20                 "world",
21                 "str1" => "hello",
22                 "str2" => "world");
23
24$array2 = array( b"1" => 'hello',
25                 b"world",
26                 "hello",
27                 'test');
28
29var_dump(array_diff($array1, $array2));
30var_dump(array_diff($array2, $array1));
31
32echo "Done";
33?>
34--EXPECT--
35*** Testing array_diff() : usage variations ***
36array(1) {
37  [0]=>
38  string(1) "1"
39}
40array(1) {
41  [4]=>
42  string(4) "test"
43}
44Done
45