3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?hh $foo = $x ==> $x + 1; $foo(12); // returns 13 $squared = array_map($x ==> $x*$x, array(1,2,3)); var_dump($squared); // $squared is array(1,4,9)
Output for hhvm-3.10.0 - 3.12.0
array(3) { [0]=> int(1) [1]=> int(4) [2]=> int(9) }
Output for 5.4.0 - 5.4.30
Parse error: syntax error, unexpected '$foo' (T_VARIABLE) in /in/nFRcX on line 2
Process exited with code 255.
Output for 5.3.0 - 5.3.29
<?hh $foo = $x ==> $x + 1; $foo(12); // returns 13 $squared = array_map($x ==> $x*$x, array(1,2,3)); var_dump($squared); // $squared is array(1,4,9)