3v4l.org

run code in 300+ PHP versions simultaneously
<?php class StaticA { public function setEmail($redirect) { $this->email = $redirect; } function dosomething(){ $obj = new static; //$obj->email = $this->email; //$obj->email = "e@01art.de"; $obj->classInfo(); } function classInfo(){ echo get_class(new static). "\n"; echo $this->email; } } class StaticB extends StaticA { function test(){ //echo get_class(new self). "\n"; parent::classInfo(); } function doit(){ parent::dosomething(); echo $this->email; } } $object = new StaticB(); $object->setEmail("erno@01art.de"); $object->doit();
Output for git.master, git.master_jit, rfc.property-hooks
Deprecated: Creation of dynamic property StaticB::$email is deprecated in /in/nOfWK on line 6 StaticB Warning: Undefined property: StaticB::$email in /in/nOfWK on line 21 erno@01art.de

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:
46.23 ms | 401 KiB | 8 Q