3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class Hoge { function destroyThis() { $tmp = &$this; $tmp = 'HAHAHA'; var_dump($this); } function afterCheck() { var_dump($this); } } $hoge = new Hoge; $hoge->destroyThis(); $hoge->afterCheck();
Output for 7.1.0
object(Hoge)#1 (0) { } object(Hoge)#1 (0) { }
Output for 5.0.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.0.14
string(6) "HAHAHA" object(Hoge)#1 (0) { }
Output for 4.3.2 - 4.4.9
string(6) "HAHAHA" Fatal error: Call to a member function on a non-object in /in/JI6OR on line 21
Process exited with code 255.
Output for 4.3.0 - 4.3.1
string(6) "HAHAHA" Fatal error: Call to a member function on a non-object in /in/JI6OR on line 21