3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $a = array( array( 'week' => 26, '#orders_CA' => 0, 'cost_CA' => 0, '#orders_US' => 3, 'cost_US' => 18.99, '#orders_INTERNATIONAL' => 0, 'cost_INTERNATIONAL' => 0 ), array( 'week' => 26, '#orders_CA' => 0, 'cost_CA' => 0, '#orders_US' => 0, 'cost_US' => 0, '#orders_INTERNATIONAL' => 22, 'cost_INTERNATIONAL' => 32 ), ); print_r(array_reduce($a, 'array_merge_recursive', $a));
Output for 4.3.0 - 4.3.9, 5.0.0 - 5.0.2, 5.3.1 - 5.6.28, hhvm-3.12.0, 7.0.0 - 7.1.0
Array ( [0] => Array ( [week] => 26 [#orders_CA] => 0 [cost_CA] => 0 [#orders_US] => 3 [cost_US] => 18.99 [#orders_INTERNATIONAL] => 0 [cost_INTERNATIONAL] => 0 ) [1] => Array ( [week] => 26 [#orders_CA] => 0 [cost_CA] => 0 [#orders_US] => 0 [cost_US] => 0 [#orders_INTERNATIONAL] => 22 [cost_INTERNATIONAL] => 32 ) [week] => Array ( [0] => 26 [1] => 26 ) [#orders_CA] => Array ( [0] => 0 [1] => 0 ) [cost_CA] => Array ( [0] => 0 [1] => 0 ) [#orders_US] => Array ( [0] => 3 [1] => 0 ) [cost_US] => Array ( [0] => 18.99 [1] => 0 ) [#orders_INTERNATIONAL] => Array ( [0] => 0 [1] => 22 ) [cost_INTERNATIONAL] => Array ( [0] => 0 [1] => 32 ) )
Output for hhvm-3.10.0

Process exited with code 153.
Output for 5.3.0
Array ( [0] => Array ( [week] => 26 [#orders_CA] => 0 [cost_CA] => 0 [#orders_US] => 3 [cost_US] => 18.99 [#orders_INTERNATIONAL] => 0 [cost_INTERNATIONAL] => 0 ) [1] => Array ( [week] => Array ( [0] => 26 ) [#orders_CA] => Array ( [0] => 0 ) [cost_CA] => Array ( [0] => 0 ) [#orders_US] => Array ( [0] => 0 ) [cost_US] => Array ( [0] => 0 ) [#orders_INTERNATIONAL] => Array ( [0] => 22 ) [cost_INTERNATIONAL] => Array ( [0] => 32 ) ) [week] => Array ( [0] => 26 [1] => 26 ) [#orders_CA] => Array ( [0] => 0 [1] => 0 ) [cost_CA] => Array ( [0] => 0 [1] => 0 ) [#orders_US] => Array ( [0] => 3 [1] => 0 ) [cost_US] => Array ( [0] => 18.99 [1] => 0 ) [#orders_INTERNATIONAL] => Array ( [0] => 0 [1] => 22 ) [cost_INTERNATIONAL] => Array ( [0] => 0 [1] => 32 ) )
Output for 5.0.3 - 5.2.17
Warning: array_merge_recursive(): Argument #1 is not an array in /in/nlt27 on line 23 Warning: array_merge_recursive(): Argument #1 is not an array in /in/nlt27 on line 23
Output for 4.3.10 - 4.4.9
Array ( [0] => 1 [week] => Array ( [0] => 26 [1] => 26 ) [#orders_CA] => Array ( [0] => 0 [1] => 0 ) [cost_CA] => Array ( [0] => 0 [1] => 0 ) [#orders_US] => Array ( [0] => 3 [1] => 0 ) [cost_US] => Array ( [0] => 18.99 [1] => 0 ) [#orders_INTERNATIONAL] => Array ( [0] => 0 [1] => 22 ) [cost_INTERNATIONAL] => Array ( [0] => 0 [1] => 32 ) )