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->classInfo(); } function classInfo(){ echo get_class(new static). "\n"; echo $this->email. "\n"; } } class StaticB extends StaticA { function test(){ //echo get_class(new self). "\n"; parent::classInfo(); } function doit(){ $this->dosomething(); echo $this->email. "\n"; } function dosomething(){ echo "YOU SUCK AT PHOTOSHOP!"; echo parent::dosomething(); echo $obj->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/CjLs5 on line 6 YOU SUCK AT PHOTOSHOP! Deprecated: Creation of dynamic property StaticB::$email is deprecated in /in/CjLs5 on line 11 StaticB erno@01art.de Warning: Undefined variable $obj in /in/CjLs5 on line 37 Warning: Attempt to read property "email" on null in /in/CjLs5 on line 37 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:
45.63 ms | 402 KiB | 8 Q