3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { const CONSTANT = 'the constant'; static $CONSTANT = 'the static variable'; } $foo = '$CONSTANT'; echo FOO::{$foo};
Output for 5.4.13
Parse error: syntax error, unexpected ';', expecting '(' in /in/EG99Y on line 9
Process exited with code 255.
Output for 5.4.0 - 5.4.12
Parse error: syntax error, unexpected ';', expecting '(' in qepls on line 9
Process exited with code 255.
Output for 5.3.23
Parse error: syntax error, unexpected '{', expecting T_STRING or T_VARIABLE or '$' in /in/EG99Y on line 9
Process exited with code 255.
Output for 5.3.0 - 5.3.22
Parse error: syntax error, unexpected '{', expecting T_STRING or T_VARIABLE or '$' in qepls on line 9
Process exited with code 255.

preferences:
169.91 ms | 1399 KiB | 45 Q