3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function test(Object $f) { var_dump($f); } class Foo {} $x = new Foo; test($x);
based on KqXuh
Output for 7.2.0
object(Foo)#1 (0) { }
Output for 7.0.0 - 7.1.10
Fatal error: Uncaught TypeError: Argument 1 passed to test() must be an instance of Object, instance of Foo given, called in /in/svcIG on line 11 and defined in /in/svcIG:3 Stack trace: #0 /in/svcIG(11): test(Object(Foo)) #1 {main} thrown in /in/svcIG on line 3
Process exited with code 255.
Output for 5.4.0 - 5.6.28
Catchable fatal error: Argument 1 passed to test() must be an instance of Object, instance of Foo given, called in /in/svcIG on line 11 and defined in /in/svcIG on line 3
Process exited with code 255.