3v4l.org

run code in 300+ PHP versions simultaneously
<?php function enum() { for($enums = func_get_args(), $enum = reset($enums), $i = 1; $enum; $enum = next($enums), ++$i) { const $enum = $i; } } // enum() enum('CONST0', 'CONST1', 'CONST2');
Output for 5.4.0 - 5.4.9
Parse error: syntax error, unexpected 'const' (T_CONST) in gY1dI on line 6
Process exited with code 255.
Output for 5.3.0 - 5.3.19
Parse error: syntax error, unexpected T_CONST in gY1dI on line 6
Process exited with code 255.

preferences:
157.5 ms | 1432 KiB | 7 Q