1--TEST--
2Test array_merge() function : basic functionality
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 * Test basic functionality of array_merge()
12 */
13
14echo "*** Testing array_merge() : basic functionality ***\n";
15
16//indexed array
17$array1 = array ('zero', 'one', 'two');
18//associative array
19$array2 = array ('a' => 1, 'b' => 2, 'c' => 3);
20
21var_dump(array_merge($array1, $array2));
22
23var_dump(array_merge($array2, $array1));
24
25echo "Done";
26?>
27
28--EXPECTF--
29*** Testing array_merge() : basic functionality ***
30array(6) {
31  [0]=>
32  string(4) "zero"
33  [1]=>
34  string(3) "one"
35  [2]=>
36  string(3) "two"
37  ["a"]=>
38  int(1)
39  ["b"]=>
40  int(2)
41  ["c"]=>
42  int(3)
43}
44array(6) {
45  ["a"]=>
46  int(1)
47  ["b"]=>
48  int(2)
49  ["c"]=>
50  int(3)
51  [0]=>
52  string(4) "zero"
53  [1]=>
54  string(3) "one"
55  [2]=>
56  string(3) "two"
57}
58Done