3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Shirt extends Sweater { public function test() { return "Shirt"; } } class Sweater extends Shirt { public function test() { return "Sweater"; } } $shirt = new Shirt(); output_shirt($shirt); function output_shirt(Sweater $shirt) { echo $shirt->test(); }
based on 91TQB
Output for 7.0.0 - 7.2.0
Fatal error: Class 'Sweater' not found in /in/cdXca on line 3
Process exited with code 255.
Output for 5.3.19 - 5.6.28
Fatal error: Class 'Sweater' not found in /in/cdXca on line 4
Process exited with code 255.