1--TEST-- 2Test array_merge_recursive() function : basic functionality - array with default keys 3--FILE-- 4<?php 5echo "*** Testing array_merge_recursive() : array with default keys ***\n"; 6 7// Initialise the arrays 8$arr1 = array(1, array(1, 2)); 9$arr2 = array(3, array("hello", 'world')); 10$arr3 = array(array(6, 7), array("str1", 'str2')); 11 12// Calling array_merge_recursive() without arguments 13echo "-- Without arguments --\n"; 14var_dump( array_merge_recursive() ); 15 16// Calling array_merge_recursive() with default arguments 17echo "-- With default argument --\n"; 18var_dump( array_merge_recursive($arr1) ); 19 20// Calling array_merge_recursive() with more arguments 21echo "-- With more arguments --\n"; 22var_dump( array_merge_recursive($arr1,$arr2) ); 23var_dump( array_merge_recursive($arr1,$arr2,$arr3) ); 24 25echo "Done"; 26?> 27--EXPECT-- 28*** Testing array_merge_recursive() : array with default keys *** 29-- Without arguments -- 30array(0) { 31} 32-- With default argument -- 33array(2) { 34 [0]=> 35 int(1) 36 [1]=> 37 array(2) { 38 [0]=> 39 int(1) 40 [1]=> 41 int(2) 42 } 43} 44-- With more arguments -- 45array(4) { 46 [0]=> 47 int(1) 48 [1]=> 49 array(2) { 50 [0]=> 51 int(1) 52 [1]=> 53 int(2) 54 } 55 [2]=> 56 int(3) 57 [3]=> 58 array(2) { 59 [0]=> 60 string(5) "hello" 61 [1]=> 62 string(5) "world" 63 } 64} 65array(6) { 66 [0]=> 67 int(1) 68 [1]=> 69 array(2) { 70 [0]=> 71 int(1) 72 [1]=> 73 int(2) 74 } 75 [2]=> 76 int(3) 77 [3]=> 78 array(2) { 79 [0]=> 80 string(5) "hello" 81 [1]=> 82 string(5) "world" 83 } 84 [4]=> 85 array(2) { 86 [0]=> 87 int(6) 88 [1]=> 89 int(7) 90 } 91 [5]=> 92 array(2) { 93 [0]=> 94 string(4) "str1" 95 [1]=> 96 string(4) "str2" 97 } 98} 99Done 100