3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class A { function __destruct() { echo "a dtor\n"; } } class B { function __destruct() { echo "b dtor\n"; } function doSomething() { echo "b still alive\n"; } $a = new A; $b = new B;
Output for 5.4.0 - 5.4.8
Parse error: syntax error, unexpected '$a' (T_VARIABLE), expecting function (T_FUNCTION) in /in/DeAPE on line 5
Process exited with code 255.
Output for 5.3.0 - 5.3.18
Parse error: syntax error, unexpected T_VARIABLE, expecting T_FUNCTION in /in/DeAPE on line 5
Process exited with code 255.