3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php abstract class Base {} class Sub extends Base {} abstract class Par { abstract public function foo(Base $x); } class Child extends Par { public function foo(Sub $x) {} }
based on Q2cfM
Output for 5.4.2 - 5.6.14
Fatal error: Declaration of Child::foo() must be compatible with Par::foo(Base $x) in /in/jsccd on line 12
Process exited with code 255.
Output for 5.3.18 - 5.3.29
Fatal error: Declaration of Child::foo() must be compatible with that of Par::foo() in /in/jsccd on line 12
Process exited with code 255.