3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $arr = array( array( 'firstname' => 'Bob', 'lastname' => 'Tomato' ), array( 'firstname' => 'Larry', 'lastname' => 'Cucumber' ) ); $keys = array_keys($arr[0]); // get all keys; $var = call_user_func_array("array_column", array_merge(array($arr), $keys)); print_r($var); ?>
Output for 5.5.24 - 5.6.28, hhvm-3.12.0, 7.0.0 - 7.1.0
Array ( [Tomato] => Bob [Cucumber] => Larry )
Output for hhvm-3.10.0

Process exited with code 153.
Output for 5.3.0 - 5.4.45
Warning: call_user_func_array() expects parameter 1 to be a valid callback, function 'array_column' not found or invalid function name in /in/nZfj0 on line 14
Output for 5.0.0 - 5.2.17
Warning: call_user_func_array(): First argument is expected to be a valid callback, 'array_column' was given in /in/nZfj0 on line 14
Output for 4.3.2 - 4.4.9
Warning: call_user_func_array(): First argumented is expected to be a valid callback, 'array_column' was given in /in/nZfj0 on line 14
Output for 4.3.0 - 4.3.1
Warning: call_user_func_array() [http://www.php.net/function.call-user-func-array]: First argumented is expected to be a valid callback, 'array_column' was given in /in/nZfj0 on line 14