3v4l.org

run code in 300+ PHP versions simultaneously
<?php interface intf{ public function setVar($a); public function getVar(); } class A implements intf{ private $A; public function setVar($a){ $this->A=$a; } public function getVar(){ return $this->A; } } class B extends Abs{ private $B; public function setVar($a){ $this->B=$a; } public function getVar(){ return $this->B; } } abstract class Abs{ abstract public function setVar($a); abstract public function getVar(); public function make_double_var($a){ return $a*2; } } $A=new A(); $B=new B(); $A->setVar(2); echo 'Class A'.$A->getVar(); $B->setVar(4); echo 'Class B'.$B->getVar(); echo 'Class B'.$B->get_double($B->getVar());
Output for git.master, git.master_jit, rfc.property-hooks
Class A2Class B4 Fatal error: Uncaught Error: Call to undefined method B::get_double() in /in/DiGKc:44 Stack trace: #0 {main} thrown in /in/DiGKc on line 44
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:
25.74 ms | 401 KiB | 8 Q