3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php interface I { public function dummyMethod(); } class A implements I { public function dummyMethod(): A {} } class B extends A { public function dummyMethod(): B {} } class C implements I { public function dummyMethod(): C {} } (new A())->dummyMethod(); (new B())->dummyMethod(); (new C())->dummyMethod();