3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $arr = [11, 'f' => 22, 33]; $a = array_map(function ($v) { return "v$v " ; }, $arr); print_r($a); $arr = ['key1' => 1, 'key2' => 3, 'key3' => 3]; $a = array_map(function ($v) { return "v$v " ; }, $arr); print_r($a);
based on EsEDr
Output for 5.6.0 - 5.6.30, hhvm-3.15.4, 7.0.0 - 7.3.0rc3
Array ( [0] => v11 [f] => v22 [1] => v33 ) Array ( [key1] => v1 [key2] => v3 [key3] => v3 )