3v4l.org

run code in 300+ PHP versions simultaneously
<?php class weird { var $myvar; function __construct() { $this->myvar = "A"; $this->$myvar = "B"; $this->${'myvar'} = "C"; $this->${'$myvar'} = "D"; echo 'this->myvar: '.$this->myvar."\n"; echo 'this->$myvar: '.$this->$myvar."\n"; echo 'this->${\'myvar\'}: '.$this->${'myvar'}."\n"; echo 'this->${\'$myvar\'}: '.$this->${'$myvar'}."\n"; echo 'this->$$$$$$$myvar: '.$this->$$$$$$$myvar."\n"; echo 'this->$$$$$$${\'$$$myvar\'}: ' . $this->$$$$$$${'$$$myvar'}."\n"; } } $obj = new weird; ?>
Output for git.master, git.master_jit, rfc.property-hooks
Warning: Undefined variable $myvar in /in/3bfGs on line 9 Deprecated: Creation of dynamic property weird::$ is deprecated in /in/3bfGs on line 9 Warning: Undefined variable $myvar in /in/3bfGs on line 10 Warning: Undefined variable $$myvar in /in/3bfGs on line 11 this->myvar: A Warning: Undefined variable $myvar in /in/3bfGs on line 14 this->$myvar: D Warning: Undefined variable $myvar in /in/3bfGs on line 15 this->${'myvar'}: D Warning: Undefined variable $$myvar in /in/3bfGs on line 16 this->${'$myvar'}: D Warning: Undefined variable $myvar in /in/3bfGs on line 17 Warning: Undefined variable $ in /in/3bfGs on line 17 Warning: Undefined variable $ in /in/3bfGs on line 17 Warning: Undefined variable $ in /in/3bfGs on line 17 Warning: Undefined variable $ in /in/3bfGs on line 17 Warning: Undefined variable $ in /in/3bfGs on line 17 Warning: Undefined variable $ in /in/3bfGs on line 17 this->$$$$$$$myvar: D Warning: Undefined variable $$$$myvar in /in/3bfGs on line 19 Warning: Undefined variable $ in /in/3bfGs on line 19 Warning: Undefined variable $ in /in/3bfGs on line 19 Warning: Undefined variable $ in /in/3bfGs on line 19 Warning: Undefined variable $ in /in/3bfGs on line 19 Warning: Undefined variable $ in /in/3bfGs on line 19 Warning: Undefined variable $ in /in/3bfGs on line 19 this->$$$$$$${'$$$myvar'}: D

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:
55.41 ms | 404 KiB | 8 Q