3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_mode=1); interface BarInterface { } interface ServerBarInterface { public function doBar(); } interface FooInterface { public function doFoo(BarInterface $bar); } class SomeFoo implements FooInterface { public function doFoo(ServerBarInterface $bar) { $bar->doBar(); } } class RegularBar implements BarInterface {} class ServerBar implements ServerBarInterface { public function doBar() { echo "works"; } } $foo = new SomeFoo; $bar = new RegularBar; $foo->doFoo($bar);
Output for git.master, git.master_jit, rfc.property-hooks
Warning: Unsupported declare 'strict_mode' in /in/M5Buf on line 2 Fatal error: Declaration of SomeFoo::doFoo(ServerBarInterface $bar) must be compatible with FooInterface::doFoo(BarInterface $bar) in /in/M5Buf on line 25
Process exited with code 255.

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:
59.13 ms | 401 KiB | 8 Q