3v4l.org

run code in 300+ PHP versions simultaneously
<?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) {} }
Output for 5.4.2 - 5.4.45, 5.5.24 - 5.5.30, 5.6.7 - 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.

preferences:
174.98 ms | 1400 KiB | 65 Q