3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $a = function () { echo 'hello'; }; function myfunction(callable $a, callable $b = null) { if (null !== $a) call_user_func($a); if (null !== $b) call_user_func($b); } myfunction($a);
based on d6mur
Output for 5.4.8 - 7.2.0
hello
Output for 5.3.18 - 5.3.29
Catchable fatal error: Argument 1 passed to myfunction() must be an instance of callable, instance of Closure given, called in /in/bfbJB on line 10 and defined in /in/bfbJB on line 5
Process exited with code 255.