3v4l.org

run code in 300+ PHP versions simultaneously
<?php class foo { private $proxy; public function __construct(self $proxy = null) { $this->proxy = $proxy ?: $this; } public function getFoo() { extract(['this' => $this->proxy]); return $this->foo; } } class fooProxy extends foo { protected $proxy; private $foo; public function __construct($foo) { $this->foo = $foo; } public function __set($name, $value) { echo __FUNCTION__, "\n"; $this->$name = $value; } public function __get($name) { echo __FUNCTION__, "\n"; return $this->$name; } } $p = new fooProxy(123); echo $p->getFoo(); echo "\n";
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught Error: Cannot re-assign $this in /in/WBlGY:14 Stack trace: #0 /in/WBlGY(14): extract(Array) #1 /in/WBlGY(46): foo->getFoo() #2 {main} thrown in /in/WBlGY on line 14
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:
82.4 ms | 401 KiB | 8 Q