3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php declare(strict_types=1); class A {} class B extends A {} class C extends B {} class D {} interface InterfaceTest { public function foo(); } abstract class AbstractTest { public abstract function foo(); } class TestAbstractContravariance extends AbstractTest { public function foo(): D {} } class TestAbstractCovariance extends AbstractTest { public function foo(): D {} } class TestInterfaceContravariance implements InterfaceTest { public function foo(): D {} } class TestInterfaceCovariance implements InterfaceTest { public function foo(): D {} }
based on 6hsZ8
Output for 7.0.0 - 7.2.0
Output for 5.3.18 - 5.6.28
Warning: Unsupported declare 'strict_types' in /in/B22nE on line 3 Parse error: syntax error, unexpected ':', expecting ';' or '{' in /in/B22nE on line 16
Process exited with code 255.