3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $array = array( array( array( 'name' => 'Mary', 'id' => 4, ) ), array(array( 'name' => 'Jane', 'id' => 20, )), ); $array = array_reduce($array, 'array_merge', array()); print_r( array_combine(array_map('end', $array), array_map('reset', $array)) );
Output for 5.0.0 - 5.0.2, 5.3.0 - 5.6.26, hhvm-3.10.0 - 3.13.2, 7.0.0 - 7.1.0
Array ( [4] => Mary [20] => Jane )
Output for 5.0.3 - 5.2.17
Warning: array_merge(): Argument #1 is not an array in /in/mROGg on line 20 Warning: array_merge(): Argument #1 is not an array in /in/mROGg on line 20 Warning: array_map(): Argument #2 should be an array in /in/mROGg on line 23 Warning: array_map(): Argument #2 should be an array in /in/mROGg on line 23 Warning: array_combine() expects parameter 1 to be array, null given in /in/mROGg on line 23
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: array_combine() in /in/mROGg on line 23
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Fatal error: Call to undefined function: array_combine() in /in/mROGg on line 23
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: array_combine() in /in/mROGg on line 23