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/g9LZO on line 9
Process exited with code 255.
Output for 5.4.0 - 5.4.12
Parse error: syntax error, unexpected ';', expecting '(' in UMtkM 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/g9LZO 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 UMtkM on line 9
Process exited with code 255.

preferences:
177.21 ms | 1399 KiB | 45 Q