3v4l.org

run code in 300+ PHP versions simultaneously
<?php interface Foo { public function doSomething(string $param1); } class Bar implements Foo { public function doSomething(string $param1) { echo "Bar: " . $param1; } } class Baz implements Foo { // Using a named parameter different from Foo's signature public function doSomething(string $paramName) { echo "Baz: " . $paramName; } } function processFoo(Foo $foo) { $foo->doSomething(param1: "Test"); } $bar = new Bar(); $baz = new Baz(); processFoo($bar); // Works fine processFoo($baz); // Fatal error:
Output for git.master, git.master_jit, rfc.property-hooks
Bar: Test Fatal error: Uncaught Error: Unknown named parameter $param1 in /in/L1Ki3:21 Stack trace: #0 /in/L1Ki3(28): processFoo(Object(Baz)) #1 {main} thrown in /in/L1Ki3 on line 21
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:
26.83 ms | 405 KiB | 5 Q