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 27--EXPECTF-- 28*** Testing array_merge() : usage variations *** 29array(8) { 30 [0]=> 31 string(4) "zero" 32 [1]=> 33 string(6) "twenty" 34 ["thirty"]=> 35 int(30) 36 [2]=> 37 string(4) "bool" 38 [3]=> 39 string(5) "float" 40 [4]=> 41 int(1) 42 [5]=> 43 int(2) 44 [""]=> 45 string(4) "null" 46} 47array(8) { 48 [0]=> 49 string(5) "float" 50 [1]=> 51 int(1) 52 [2]=> 53 int(2) 54 [""]=> 55 string(4) "null" 56 [3]=> 57 string(4) "zero" 58 [4]=> 59 string(6) "twenty" 60 ["thirty"]=> 61 int(30) 62 [5]=> 63 string(4) "bool" 64} 65Done