3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php error_reporting(E_ALL); function a(callable $a) { } try { a('foo'); } catch (\Exception $e) { echo "Catched"; }
based on R7Fkm
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught TypeError: Argument 1 passed to a() must be callable, string given, called in /in/XhTb5 on line 10 and defined in /in/XhTb5:5 Stack trace: #0 /in/XhTb5(10): a('foo') #1 {main} thrown in /in/XhTb5 on line 5
Process exited with code 255.
Output for 5.4.10 - 5.6.28
Catchable fatal error: Argument 1 passed to a() must be callable, string given, called in /in/XhTb5 on line 10 and defined in /in/XhTb5 on line 5
Process exited with code 255.
Output for 5.3.20 - 5.3.29
Catchable fatal error: Argument 1 passed to a() must be an instance of callable, string given, called in /in/XhTb5 on line 10 and defined in /in/XhTb5 on line 5
Process exited with code 255.