3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $array = [1, 2, 3, 4]; $callable = function($value) { return $value * 100; }; $newArray = array_map($callable, $array); print_r($array); print_r($newArray);
based on 00A4W
Output for 5.4.10 - 7.2.0
Array ( [0] => 1 [1] => 2 [2] => 3 [3] => 4 ) Array ( [0] => 100 [1] => 200 [2] => 300 [3] => 400 )
Output for 5.3.20 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/gaZSd on line 3
Process exited with code 255.