3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function a(callable $a) { } try { a('foo'); } catch (\TypeError $e) { echo "Catched"; }
based on cZWtq
Output for 7.0.0 - 7.2.0
Catched
Output for 5.4.10 - 5.6.28
Catchable fatal error: Argument 1 passed to a() must be callable, string given, called in /in/RK78v on line 8 and defined in /in/RK78v on line 3
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/RK78v on line 8 and defined in /in/RK78v on line 3
Process exited with code 255.