3v4l.org

run code in 300+ PHP versions simultaneously
<?php interface Test { public function check(Test $x); } interface BarInterface extends Test { public function check(BarInterface $x); }; //this is ok: class Foo implements Test { public function check(Test $x) {} } //this is fail, but why? Bar implements Test, so.. logically it fulfills contract.. class Bar implements Test { public function check(BarInterface $x) {} }
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Declaration of BarInterface::check(BarInterface $x) must be compatible with Test::check(Test $x) in /in/ljUPo on line 10
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.11 ms | 401 KiB | 8 Q