3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class User {} class Request {} function doStuff(Request $r) { // ... } $u = new User(); doStuff($u);
based on 11e14
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught TypeError: Argument 1 passed to doStuff() must be an instance of Request, instance of User given, called in /in/835g5 on line 12 and defined in /in/835g5:6 Stack trace: #0 /in/835g5(12): doStuff(Object(User)) #1 {main} thrown in /in/835g5 on line 6
Process exited with code 255.
Output for 5.3.22 - 5.6.28
Catchable fatal error: Argument 1 passed to doStuff() must be an instance of Request, instance of User given, called in /in/835g5 on line 12 and defined in /in/835g5 on line 6
Process exited with code 255.