3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function partialLeft(callable $cb) { return function($left) use ($cb) { return function($right) use ($cb, $left) { return $cb($left, $right); }; }; } $a = partialLeft(null); $b = $a("hello"); $c = $b("robert");
based on kg5uP
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught TypeError: Argument 1 passed to partialLeft() must be callable, null given, called in /in/SV8Y2 on line 10 and defined in /in/SV8Y2:3 Stack trace: #0 /in/SV8Y2(10): partialLeft(NULL) #1 {main} thrown in /in/SV8Y2 on line 3
Process exited with code 255.
Output for 5.4.1 - 5.6.28
Catchable fatal error: Argument 1 passed to partialLeft() must be callable, null given, called in /in/SV8Y2 on line 10 and defined in /in/SV8Y2 on line 3
Process exited with code 255.
Output for 5.3.18 - 5.3.29
Catchable fatal error: Argument 1 passed to partialLeft() must be an instance of callable, null given, called in /in/SV8Y2 on line 10 and defined in /in/SV8Y2 on line 3
Process exited with code 255.