3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $sum = function($l):integer { return function($r) use ($l) { return $l + $r; }; }; echo $sum(4)(2);
based on mZHt3
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught TypeError: Return value of {closure}() must be an instance of integer, instance of Closure returned in /in/ZvT5s:5 Stack trace: #0 /in/ZvT5s(9): {closure}(4) #1 {main} thrown in /in/ZvT5s on line 5
Process exited with code 255.
Output for 5.4.0 - 5.6.28
Parse error: syntax error, unexpected ':', expecting '{' in /in/ZvT5s on line 2
Process exited with code 255.