3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php abstract class A { abstract function bar(stdClass $x); } abstract class B extends A { abstract function bar($x): stdClass; } class C extends B { function bar($x): stdClass{} }
Output for 7.0.0 - 7.1.7
Fatal error: Can't inherit abstract function A::bar() (previously declared abstract in B) in /in/CoT8h on line 5
Process exited with code 255.
Output for hhvm-3.15.4
Fatal error: Uncaught Error: Cannot re-declare abstract method A::bar() abstract in class B in /in/CoT8h:5 Stack trace: #0 {main}
Process exited with code 255.
Output for 5.6.0 - 5.6.30
Parse error: syntax error, unexpected ':', expecting ';' or '{' in /in/CoT8h on line 5
Process exited with code 255.