3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $fn = (function(callable $x){}); $fn("foo");
based on UP3dm
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught TypeError: Argument 1 passed to {closure}() must be callable, string given, called in /in/qK1Uc on line 5 and defined in /in/qK1Uc:3 Stack trace: #0 /in/qK1Uc(5): {closure}('foo') #1 {main} thrown in /in/qK1Uc on line 3
Process exited with code 255.
Output for 5.4.10 - 5.6.28
Catchable fatal error: Argument 1 passed to {closure}() must be callable, string given, called in /in/qK1Uc on line 5 and defined in /in/qK1Uc on line 3
Process exited with code 255.
Output for 5.3.20 - 5.3.29
Catchable fatal error: Argument 1 passed to {closure}() must be an instance of callable, string given, called in /in/qK1Uc on line 5 and defined in /in/qK1Uc on line 3
Process exited with code 255.