3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class ClassSave { function __destruct(){ global $test; $test = $this; echo "Destruct\r\n"; } } echo "1: "; new ClassSave(); echo "2: "; var_dump($test); $test = null; unset($test); echo "End\r\n"; Expected result: ---------------- 1: Destruct 2: Destruct End Actual result: -------------- 1: Destruct 2: End
Output for 5.4.0 - 5.4.22
Parse error: syntax error, unexpected 'result' (T_STRING) in /in/9v35P on line 18
Process exited with code 255.
Output for 5.3.0 - 5.3.27
Parse error: syntax error, unexpected T_STRING in /in/9v35P on line 18
Process exited with code 255.