3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class A {} class B extends A {} class C extends B {} class D {} interface InterfaceTest { public function foo($d); } abstract class AbstractTest { public abstract function foo($d); } class TestAbstractContravariance extends AbstractTest { public function foo($d) : D {} } class TestAbstractCovariance extends AbstractTest { public function foo($d) : D {} } class TestInterfaceContravariance implements InterfaceTest { public function foo($d) : D {} } class TestInterfaceCovariance implements InterfaceTest { public function foo($d) : D {} }
based on 5faGB
Output for 7.0.0 - 7.2.0
Output for 5.3.18 - 5.6.28
Parse error: syntax error, unexpected ':', expecting ';' or '{' in /in/ecoVB on line 14
Process exited with code 255.