3v4l.org - online PHP & HHVM shell, execute code in 100+ different versions!

<?php function enum() { for($enums = func_get_args(), $enum = reset($enums), $i = 1; $enum; $enum = next($enums), ++$i) { eval('const ' . $enum . ' = ' . $i . ';'); } } // enum() enum('CONST0', 'CONST1', 'CONST2'); print_r(CONST0);
Output for 5.3.0 - 5.6.3, php7@20140507 - 20141101, hhvm-3.0.1 - 3.4.0
1
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.2.17
Parse error: syntax error, unexpected T_CONST in /in/EC0gF(6) : eval()'d code on line 1 Parse error: syntax error, unexpected T_CONST in /in/EC0gF(6) : eval()'d code on line 1 Parse error: syntax error, unexpected T_CONST in /in/EC0gF(6) : eval()'d code on line 1 Notice: Use of undefined constant CONST0 - assumed 'CONST0' in /in/EC0gF on line 13 CONST0
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected T_CONST in /in/EC0gF(6) : eval()'d code on line 1 Parse error: parse error, unexpected T_CONST in /in/EC0gF(6) : eval()'d code on line 1 Parse error: parse error, unexpected T_CONST in /in/EC0gF(6) : eval()'d code on line 1 Notice: Use of undefined constant CONST0 - assumed 'CONST0' in /in/EC0gF on line 13 CONST0
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/EC0gF(6) : eval()'d code on line 1 Parse error: parse error in /in/EC0gF(6) : eval()'d code on line 1 Parse error: parse error in /in/EC0gF(6) : eval()'d code on line 1 Notice: Use of undefined constant CONST0 - assumed 'CONST0' in /in/EC0gF on line 13 CONST0
Process exited with code 255.