3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function curry($f, ...$argsCurried) { return function(...$args) use($f, $argsCurried) { $finalArgs = array_merge($argsCurried, $args); return call_user_func_array($f, $finalArgs); }; } function add($n1, $n2) { return $n1 + $n2; } $addFive = curry('add', 5); echo $addFive(2), PHP_EOL; echo $addFive(-5), PHP_EOL;
Output for 5.6.30, hhvm-3.18.5 - 3.22.0, 7.0.28 - 7.2.9
7 0