3v4l.org

run code in 300+ PHP versions simultaneously
<?php class weird { var $myvar; var $other; var $blee; var $bla; function __construct() { $myvar = 'other'; ${'myvar'} = 'blee'; ${'$myvar'} = 'bla'; $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
this->myvar: A this->$myvar: C this->${'myvar'}: C this->${'$myvar'}: D Warning: Undefined variable $blee in /in/feoW8 on line 23 Warning: Undefined variable $ in /in/feoW8 on line 23 Warning: Undefined variable $ in /in/feoW8 on line 23 Warning: Undefined variable $ in /in/feoW8 on line 23 Warning: Undefined variable $ in /in/feoW8 on line 23 Warning: Undefined variable $ in /in/feoW8 on line 23 Warning: Undefined property: weird::$ in /in/feoW8 on line 23 this->$$$$$$$myvar: Warning: Undefined variable $$$$myvar in /in/feoW8 on line 25 Warning: Undefined variable $ in /in/feoW8 on line 25 Warning: Undefined variable $ in /in/feoW8 on line 25 Warning: Undefined variable $ in /in/feoW8 on line 25 Warning: Undefined variable $ in /in/feoW8 on line 25 Warning: Undefined variable $ in /in/feoW8 on line 25 Warning: Undefined variable $ in /in/feoW8 on line 25 Warning: Undefined property: weird::$ in /in/feoW8 on line 25 this->$$$$$$${'$$$myvar'}:

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:
48.83 ms | 403 KiB | 8 Q