3v4l.org

run code in 500+ PHP versions simultaneously
<?php interface interface1 { public function myMethod1(string $param1, int $param2); public function myMethod2(int $param1); } interface interface2 { public function myMethod1(int $param1, string $param2, float $param3); public function myMethod2(float $param1); } class SomeClass implements interface1, interface2 { public function myMethod1(array $param1) { echo "In method2"; var_dump($param1); } public function myMethod2( array $param1, array $param2, array $param3) { echo "In Method2"; var_dump($param1); } } $c = new SomeClass(); $c->myMethod1(); $c->myMethod2();
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Declaration of SomeClass::myMethod1(array $param1) must be compatible with interface1::myMethod1(string $param1, int $param2) in /in/N1T30 on line 14
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:
47.01 ms | 1266 KiB | 4 Q