3v4l.org

run code in 300+ PHP versions simultaneously
<?php interface Foo { public function test(string $value); } abstract class Fan implements Foo { abstract public function test(string $value); public function otherTest(string $value) { var_dump(__METHOD__, $value); } } class Bar extends Fan implements Foo { public function test(string $value) { var_dump(__METHOD__, $value); } } class Baz extends Bar {} class Bop extends Bar { public function test(string $value) { var_dump(__METHOD__, $value); } } class Fin extends Fan { public function test(string $value) { var_dump(__METHOD__, $value); } } $bar = new Bar(); $baz = new Baz(); $bop = new Bop(); $fin = new Fin(); $bar->test('bar'); $bar->otherTest('bar'); $bar->test('baz'); $bar->otherTest('bar'); $bop->test('bop'); $bop->otherTest('bop'); $fin->test('fan'); $fin->otherTest('fan');

preferences:
54.44 ms | 402 KiB | 5 Q