3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Animal { } class Doge extends Animal { } function test(Doge $test) { } $dog = new Animal(); test($dog);
based on TgtHR
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught TypeError: Argument 1 passed to test() must be an instance of Doge, instance of Animal given, called in /in/f8HcB on line 19 and defined in /in/f8HcB:13 Stack trace: #0 /in/f8HcB(19): test(Object(Animal)) #1 {main} thrown in /in/f8HcB on line 13
Process exited with code 255.
Output for 5.3.20 - 5.6.28
Catchable fatal error: Argument 1 passed to test() must be an instance of Doge, instance of Animal given, called in /in/f8HcB on line 19 and defined in /in/f8HcB on line 13
Process exited with code 255.