3v4l.org

run code in 300+ PHP versions simultaneously
<?php // lib 1 code: interface Lib1Interface { // name was originally $myparam, but has been changed. public function method($mychangedparam); } // lib 2 code: class Lib2Implementation implements Lib1Interface { public function method($myparam) { echo $myparam; } } // your code: class MyImplementation implements Lib1Interface { public function method($mychangedparam) { echo $mychangedparam; } } function doStuff(Lib1Interface $interface) { // named params can't be used here because of implementation details elsewhere. this is very opaque. $interface->method(mychangedparam: 42); } doStuff(new Lib2Implementation()); doStuff(new MyImplementation());
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught Error: Unknown named parameter $mychangedparam in /in/XSSo9:31 Stack trace: #0 /in/XSSo9(34): doStuff(Object(Lib2Implementation)) #1 {main} thrown in /in/XSSo9 on line 31
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:
126.41 ms | 405 KiB | 5 Q