3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?hh enum DayOfWeek: int { Sunday = 0; Monday = 1; Tuesday = 2; Wednesday = 3; Thursday = 4; Friday = 5; Saturday = 6; } function foo(): int { return DayOfWeek::Wednesday; // returns a 3 } echo foo();
based on ldIJD
Output for 5.4.34
Parse error: syntax error, unexpected 'enum' (T_STRING) in /in/5JGrp on line 3
Process exited with code 255.
Output for 5.4.0 - 5.4.32
<?hh enum DayOfWeek: int { Sunday = 0; Monday = 1; Tuesday = 2; Wednesday = 3; Thursday = 4; Friday = 5; Saturday = 6; } function foo(): int { return DayOfWeek::Wednesday; // returns a 3 } echo foo();