3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class a { function overWrite() { $tmp = &$this; $this = new b; } } class b { } $a = new a; $a->overWrite(); var_dump($a);
Output for 5.3.0 - 5.4.17
Fatal error: Cannot re-assign $this in /in/Ynp8F on line 7
Process exited with code 255.