1--TEST--
2Test array_merge() function : usage variations - string 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 string keys to test behaviour.
12 * $arr2 has a duplicate key to $arr1
13 */
14
15echo "*** Testing array_merge() : usage variations ***\n";
16
17//string keys
18$arr1 = array('zero' => 'zero', 'one' => 'un', 'two' => 'deux');
19$arr2 = array('zero' => 'zero', 'un' => 'eins', 'deux' => 'zwei');
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(5) {
29  ["zero"]=>
30  string(4) "zero"
31  ["one"]=>
32  string(2) "un"
33  ["two"]=>
34  string(4) "deux"
35  ["un"]=>
36  string(4) "eins"
37  ["deux"]=>
38  string(4) "zwei"
39}
40array(5) {
41  ["zero"]=>
42  string(4) "zero"
43  ["un"]=>
44  string(4) "eins"
45  ["deux"]=>
46  string(4) "zwei"
47  ["one"]=>
48  string(2) "un"
49  ["two"]=>
50  string(4) "deux"
51}
52Done
53