1--TEST-- 2Test array_merge() function : usage variations - numeric 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 only numeric keys to test behaviour. 12 * $arr2 contains a duplicate element to $arr1. 13 */ 14 15echo "*** Testing array_merge() : usage variations ***\n"; 16 17//numeric keys 18$arr1 = array('zero', 'one', 'two', 'three'); 19$arr2 = array(1 => 'one', 20 => 'twenty', 30 => 'thirty'); 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(7) { 29 [0]=> 30 string(4) "zero" 31 [1]=> 32 string(3) "one" 33 [2]=> 34 string(3) "two" 35 [3]=> 36 string(5) "three" 37 [4]=> 38 string(3) "one" 39 [5]=> 40 string(6) "twenty" 41 [6]=> 42 string(6) "thirty" 43} 44array(7) { 45 [0]=> 46 string(3) "one" 47 [1]=> 48 string(6) "twenty" 49 [2]=> 50 string(6) "thirty" 51 [3]=> 52 string(4) "zero" 53 [4]=> 54 string(3) "one" 55 [5]=> 56 string(3) "two" 57 [6]=> 58 string(5) "three" 59} 60Done 61