3v4l.org

run code in 300+ PHP versions simultaneously
<?php error_reporting(E_ALL); $var = new StdClass(); $var->foo = 'bar'; //$this = $var; // PHP Fatal error: Cannot re-assign $this $GLOBALS['this'] = $var; var_dump($this); $var->foo = 'baz'; $foo = 'this'; $$foo = $var; var_dump($this); foo($this); function foo($this){ //global $this; // PHP Fatal error: Cannot re-assign $this // $this = $GLOBALS['var']; // PHP Fatal error: Cannot re-assign $this var_dump($this); $GLOBALS['this']->foo = 'baw'; $$GLOBALS['foo'] = $GLOBALS['this']; var_dump($$GLOBALS['foo']); var_dump($this); }

This is an error 404

There are `0` results


preferences:
153.04 ms | 1399 KiB | 7 Q