3v4l.org

run code in 300+ PHP versions simultaneously
<?php //define('B', 'pre'); class test { const A = @B; static function name() { echo self::A . 'key'; } static function init() { self::name(); } } test::init();
Output for 7.0.0
Fatal error: Constant expression contains invalid operations in /in/a8J8V on line 6
Process exited with code 255.
Output for 5.5.24 - 5.5.30, 5.6.8 - 5.6.16
Parse error: syntax error, unexpected '@' in /in/a8J8V on line 6
Process exited with code 255.

preferences:
170.81 ms | 1395 KiB | 24 Q