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_unique($a)); print_r(array_reduce($a, 'array_merge', $a));
Output for 5.4.0 - 7.1.0
Notice: Array to string conversion in /in/g4kGf on line 22 Notice: Array to string conversion in /in/g4kGf on line 22 Notice: Array to string conversion in /in/g4kGf on line 22 Notice: Array to string conversion in /in/g4kGf on line 22 Array ( [0] => Array ( [week] => 26 [#orders_CA] => 0 [cost_CA] => 0 [#orders_US] => 3 [cost_US] => 18.99 [#orders_INTERNATIONAL] => 0 [cost_INTERNATIONAL] => 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] => 26 [#orders_CA] => 0 [cost_CA] => 0 [#orders_US] => 0 [cost_US] => 0 [#orders_INTERNATIONAL] => 22 [cost_INTERNATIONAL] => 32 )
Output for 4.3.0 - 4.3.9, 5.0.0 - 5.0.2, 5.3.0 - 5.3.29
Array ( [0] => Array ( [week] => 26 [#orders_CA] => 0 [cost_CA] => 0 [#orders_US] => 3 [cost_US] => 18.99 [#orders_INTERNATIONAL] => 0 [cost_INTERNATIONAL] => 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] => 26 [#orders_CA] => 0 [cost_CA] => 0 [#orders_US] => 0 [cost_US] => 0 [#orders_INTERNATIONAL] => 22 [cost_INTERNATIONAL] => 32 )
Output for 5.0.3 - 5.2.8, 5.2.10 - 5.2.17
Array ( [0] => Array ( [week] => 26 [#orders_CA] => 0 [cost_CA] => 0 [#orders_US] => 3 [cost_US] => 18.99 [#orders_INTERNATIONAL] => 0 [cost_INTERNATIONAL] => 0 ) ) Warning: array_merge(): Argument #1 is not an array in /in/g4kGf on line 23 Warning: array_merge(): Argument #1 is not an array in /in/g4kGf on line 23
Output for 5.2.9
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 ) ) Warning: array_merge(): Argument #1 is not an array in /in/g4kGf on line 23 Warning: array_merge(): Argument #1 is not an array in /in/g4kGf on line 23
Output for 4.3.10 - 4.4.9
Array ( [0] => Array ( [week] => 26 [#orders_CA] => 0 [cost_CA] => 0 [#orders_US] => 3 [cost_US] => 18.99 [#orders_INTERNATIONAL] => 0 [cost_INTERNATIONAL] => 0 ) ) Array ( [0] => 1 [week] => 26 [#orders_CA] => 0 [cost_CA] => 0 [#orders_US] => 0 [cost_US] => 0 [#orders_INTERNATIONAL] => 22 [cost_INTERNATIONAL] => 32 )