3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $arr=array( 'key1'=>'value1', 'key2'=>'value2', 0=>array( 'sub1_key1'=>'sub1_value1', 'sub1_key2'=>'sub1_value2', ), 'key3'=>array( 'sub2_key1'=>'sub2_value1', 'sub2_key2'=>'sub2_value2', ), ); $result = call_user_func_array('array_merge', $arr); print_r($result);
Output for 5.3.0 - 5.6.28, 7.0.0 - 7.1.0
Warning: array_merge(): Argument #1 is not an array in /in/3sXo9 on line 17
Output for hhvm-3.10.0 - 3.12.0
Warning: array_merge() expects parameter 1 to be array, string given in /in/3sXo9 on line 17
Output for 5.0.0 - 5.2.17
Warning: array_merge(): Argument #1 is not an array in /in/3sXo9 on line 17 Warning: array_merge(): Argument #2 is not an array in /in/3sXo9 on line 17
Output for 4.3.0 - 4.4.9
Array ( [0] => value1 [1] => value2 [sub1_key1] => sub1_value1 [sub1_key2] => sub1_value2 [sub2_key1] => sub2_value1 [sub2_key2] => sub2_value2 )