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 27--EXPECTF-- 28*** Testing array_merge() : usage variations *** 29array(5) { 30 ["zero"]=> 31 string(4) "zero" 32 ["one"]=> 33 string(2) "un" 34 ["two"]=> 35 string(4) "deux" 36 ["un"]=> 37 string(4) "eins" 38 ["deux"]=> 39 string(4) "zwei" 40} 41array(5) { 42 ["zero"]=> 43 string(4) "zero" 44 ["un"]=> 45 string(4) "eins" 46 ["deux"]=> 47 string(4) "zwei" 48 ["one"]=> 49 string(2) "un" 50 ["two"]=> 51 string(4) "deux" 52} 53Done