3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class ClassB { private const THE_PRIVATE_CONSTANT = 9; public const THE_PUBLIC_CONSTANTS = 9; } var_dump( (new ReflectionClass(ClassB::class))->getConstants() );
Output for 7.1.0 - 7.3.0rc3
array(2) { ["THE_PRIVATE_CONSTANT"]=> int(9) ["THE_PUBLIC_CONSTANTS"]=> int(9) }
Output for 5.6.0 - 5.6.30, 7.0.0 - 7.0.20
Parse error: syntax error, unexpected 'const' (T_CONST), expecting variable (T_VARIABLE) in /in/loEnG on line 5
Process exited with code 255.
Output for hhvm-3.15.4
Fatal error: Uncaught Error: syntax error, unexpected T_CONST, expecting T_VARIABLE in /in/loEnG:5 Stack trace: #0 {main}
Process exited with code 255.