3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function foo(object $bar) { var_dump($bar); } foo(new stdClass());
Output for 7.2.0
object(stdClass)#1 (0) { }
Output for 7.0.0 - 7.1.10
Fatal error: Uncaught TypeError: Argument 1 passed to foo() must be an instance of object, instance of stdClass given, called in /in/kJQU3 on line 7 and defined in /in/kJQU3:3 Stack trace: #0 /in/kJQU3(7): foo(Object(stdClass)) #1 {main} thrown in /in/kJQU3 on line 3
Process exited with code 255.
Output for 5.3.17 - 5.6.28
Catchable fatal error: Argument 1 passed to foo() must be an instance of object, instance of stdClass given, called in /in/kJQU3 on line 7 and defined in /in/kJQU3 on line 3
Process exited with code 255.