3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function arrayTest($key) { return '1' + $key; } $arr = array('a', 'b', 'c', 'd'); $arrTwo = array_map($arr, 'arrayTest'); print_r($arr); print_r($arrTwo);
based on RNSEI
Output for 5.3.0 - 7.2.0
Warning: array_map() expects parameter 1 to be a valid callback, array must have exactly two members in /in/oZ6Yh on line 9 Array ( [0] => a [1] => b [2] => c [3] => d )
Output for 4.3.2 - 5.2.17
Warning: array_map(): The first argument, 'Array', should be either NULL or a valid callback in /in/oZ6Yh on line 9 Array ( [0] => a [1] => b [2] => c [3] => d )
Output for 4.3.0 - 4.3.1
Warning: array_map() [http://www.php.net/function.array-map]: The first argument, 'Array', should be either NULL or a valid callback in /in/oZ6Yh on line 9 Array ( [0] => a [1] => b [2] => c [3] => d )