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');
Output for git.master, git.master_jit, rfc.property-hooks
string(9) "Bar::test" string(3) "bar" string(14) "Fan::otherTest" string(3) "bar" string(9) "Bar::test" string(3) "baz" string(14) "Fan::otherTest" string(3) "bar" string(9) "Bop::test" string(3) "bop" string(14) "Fan::otherTest" string(3) "bop" string(9) "Fin::test" string(3) "fan" string(14) "Fan::otherTest" string(3) "fan"

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
66.81 ms | 402 KiB | 8 Q