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('arrayTest', $arr); print_r($arr); print_r($arrTwo);
based on JFPFD
Output for 4.3.0 - 7.2.0
Array ( [0] => a [1] => b [2] => c [3] => d ) Array ( [0] => 1a [1] => 1b [2] => 1c [3] => 1d )