3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { const OMG = 10; public function get($what) { return self::($$what); } } $test = new Test(); var_dump($test->get("OMG")); var_dump($test::OMG);
Output for 5.4.0 - 5.4.30
Parse error: syntax error, unexpected '(', expecting identifier (T_STRING) or variable (T_VARIABLE) or '{' or '$' in /in/DvNZd on line 8
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected '(', expecting T_STRING or T_VARIABLE or '$' in /in/DvNZd on line 8
Process exited with code 255.

preferences:
184.54 ms | 1386 KiB | 67 Q