3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class T { const STATUS_ACTIVE = 1; const STATUS_INACTIVE = 2; public $statuses = array( self::STATUS_ACTIVE => 'Active', self::STATUS_INACTIVE => 'Inactive', ); } var_dump(new T());
Output for 5.0.5 - 7.1.0
object(T)#1 (1) { ["statuses"]=> array(2) { [1]=> string(6) "Active" [2]=> string(8) "Inactive" } }
Output for 5.0.0 - 5.0.4
Fatal error: Cannot access self:: when no class scope is active in /in/1sbcI on line 12
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/1sbcI on line 3
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/1sbcI on line 3
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/1sbcI on line 3
Process exited with code 255.