1--TEST--
2Test array_merge() function : usage variations - Mixed keys
3--FILE--
4<?php
5/* Prototype  : array array_merge(array $arr1, array $arr2 [, array $...])
6 * Description: Merges elements from passed arrays into one array
7 * Source code: ext/standard/array.c
8 */
9
10/*
11 * Pass array_merge() arrays with mixed keys to test how it attaches them to
12 * existing arrays
13 */
14
15echo "*** Testing array_merge() : usage variations ***\n";
16
17//mixed keys
18$arr1 = array('zero', 20 => 'twenty', 'thirty' => 30, true => 'bool');
19$arr2 = array(0, 1, 2, null => 'null', 1.234E-10 => 'float');
20
21var_dump(array_merge($arr1, $arr2));
22var_dump(array_merge($arr2, $arr1));
23
24echo "Done";
25?>
26--EXPECT--
27*** Testing array_merge() : usage variations ***
28array(8) {
29  [0]=>
30  string(4) "zero"
31  [1]=>
32  string(6) "twenty"
33  ["thirty"]=>
34  int(30)
35  [2]=>
36  string(4) "bool"
37  [3]=>
38  string(5) "float"
39  [4]=>
40  int(1)
41  [5]=>
42  int(2)
43  [""]=>
44  string(4) "null"
45}
46array(8) {
47  [0]=>
48  string(5) "float"
49  [1]=>
50  int(1)
51  [2]=>
52  int(2)
53  [""]=>
54  string(4) "null"
55  [3]=>
56  string(4) "zero"
57  [4]=>
58  string(6) "twenty"
59  ["thirty"]=>
60  int(30)
61  [5]=>
62  string(4) "bool"
63}
64Done
65