3v4l.org

run code in 300+ PHP versions simultaneously
<?php enum State: string { case IA = 'Iowa'; // ... case OR = 'Oregon'; } echo State::OR;
Output for 8.1.0 - 8.1.2
Fatal error: Uncaught Error: Object of class State could not be converted to string in /in/acpBg:10 Stack trace: #0 {main} thrown in /in/acpBg on line 10
Process exited with code 255.
Output for 8.0.1 - 8.0.15
Parse error: syntax error, unexpected identifier "State" in /in/acpBg on line 3
Process exited with code 255.
Output for 7.4.0 - 7.4.27
Parse error: syntax error, unexpected 'State' (T_STRING) in /in/acpBg on line 3
Process exited with code 255.

preferences:
181.63 ms | 1395 KiB | 51 Q