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--EXPECTF--
28*** Testing array_merge() : basic functionality ***
29array(6) {
30  [0]=>
31  string(4) "zero"
32  [1]=>
33  string(3) "one"
34  [2]=>
35  string(3) "two"
36  ["a"]=>
37  int(1)
38  ["b"]=>
39  int(2)
40  ["c"]=>
41  int(3)
42}
43array(6) {
44  ["a"]=>
45  int(1)
46  ["b"]=>
47  int(2)
48  ["c"]=>
49  int(3)
50  [0]=>
51  string(4) "zero"
52  [1]=>
53  string(3) "one"
54  [2]=>
55  string(3) "two"
56}
57Done
58