3v4l.org

run code in 300+ PHP versions simultaneously
<?php abstract class AAA { public function foo () { echo $this->childValue(); } abstract public function childValue(): string; } class XXXXXX extends AAA { public function childValue (): string { return "x"; } } class YYYYYY extends AAA { public function childValue (): string { return "y"; } } class ZZZZZZ extends AAA { public function childValue (): string { return "z"; } } //class WRONG extends AAA { // if empty: // Fatal error: Class WRONG contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (AAA::childValue) in /tmp/preview on line 29 //} $objX = new XXXXXX(); $objX->foo(); $objY = new YYYYYY(); $objY->foo(); $objZ = new ZZZZZZ(); $objZ->foo();
Output for git.master_jit, git.master, rfc.property-hooks
xyz

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:
56.62 ms | 405 KiB | 5 Q