3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class A { public function b(DateTime $c) { print_r($c); } } $a = new A(); try { $a->b(""); } catch (Exception $e) { echo "catched" . $e->getMessage(); } catch (TypeError $e) { echo "subidubi" . $e->getMessage(); }
based on 4H0HO
Output for 7.0.0 - 7.2.0
subidubiArgument 1 passed to A::b() must be an instance of DateTime, string given, called in /in/SRgff on line 13
Output for 5.3.18 - 5.6.28
Catchable fatal error: Argument 1 passed to A::b() must be an instance of DateTime, string given, called in /in/SRgff on line 13 and defined in /in/SRgff on line 5
Process exited with code 255.