3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class test { const AA = 0; const BB = 1; const st_AA = 'Aa'; const st_BB = 'Bb'; public static $state = array( self::AA => self::st_AA, self::BB => self::st_BB ); } var_dump( test::$state );
Output for 5.1.0 - 7.1.0
array(2) { [0]=> string(2) "Aa" [1]=> string(2) "Bb" }
Output for 5.0.0 - 5.0.5
Fatal error: Cannot access self:: when no class scope is active in /in/40Alv on line 18
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_CONST, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/40Alv on line 5
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected T_CONST, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/40Alv on line 5
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `T_OLD_FUNCTION' or `T_FUNCTION' or `T_VAR' or `'}'' in /in/40Alv on line 5
Process exited with code 255.