1--TEST--
2Test array_merge_recursive() function : usage variations - binary safe checking
3--FILE--
4<?php
5/*
6 * Testing the functionality of array_merge_recursive() by passing an array having binary values.
7*/
8
9echo "*** Testing array_merge_recursive() : array with binary data for \$arr1 argument ***\n";
10
11// array with binary values
12$arr1 = array(b"1", b"hello" => "hello", b"world", "str1" => b"hello", "str2" => "world");
13
14// initialize the second argument
15$arr2 = array(b"str1" => b"binary", b"hello" => "binary", b"str2" => b"binary");
16
17echo "-- With default argument --\n";
18var_dump( array_merge_recursive($arr1) );
19
20echo "-- With more arguments --\n";
21var_dump( array_merge_recursive($arr1, $arr2) );
22
23echo "Done";
24?>
25--EXPECT--
26*** Testing array_merge_recursive() : array with binary data for $arr1 argument ***
27-- With default argument --
28array(5) {
29  [0]=>
30  string(1) "1"
31  ["hello"]=>
32  string(5) "hello"
33  [1]=>
34  string(5) "world"
35  ["str1"]=>
36  string(5) "hello"
37  ["str2"]=>
38  string(5) "world"
39}
40-- With more arguments --
41array(5) {
42  [0]=>
43  string(1) "1"
44  ["hello"]=>
45  array(2) {
46    [0]=>
47    string(5) "hello"
48    [1]=>
49    string(6) "binary"
50  }
51  [1]=>
52  string(5) "world"
53  ["str1"]=>
54  array(2) {
55    [0]=>
56    string(5) "hello"
57    [1]=>
58    string(6) "binary"
59  }
60  ["str2"]=>
61  array(2) {
62    [0]=>
63    string(5) "world"
64    [1]=>
65    string(6) "binary"
66  }
67}
68Done
69