3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $calc = function ($arg = null, $acc = '') use (&$calc) { return $arg === null ? $acc : function ($number = null) use (&$calc, $arg, $acc) { return $calc($number, $acc . $arg); }; }; $result = $calc(1)(3)(3)(7)(); var_dump($result); $result = $calc(2)(2)(8)(); var_dump($result);
based on v2fY4
Output for hhvm-3.15.4, 7.0.0 - 7.3.0rc3
string(4) "1337" string(3) "228"
Output for 5.6.0 - 5.6.30
Parse error: syntax error, unexpected '(' in /in/ZfIO0 on line 9
Process exited with code 255.