3v4l.org

run code in 300+ PHP versions simultaneously
<?php enum Foo { case Foo; case Bar; } foreach (Foo as $foo) { var_dump($foo); }
Output for 8.1.30 - 8.1.34, 8.2.23 - 8.2.30, 8.3.5 - 8.3.30, 8.4.1 - 8.4.18, 8.5.0 - 8.5.3
Fatal error: Uncaught Error: Undefined constant "Foo" in /in/ECh4o:9 Stack trace: #0 {main} thrown in /in/ECh4o on line 9
Process exited with code 255.
Output for 8.0.0 - 8.0.13
Parse error: syntax error, unexpected identifier "Foo" in /in/ECh4o on line 3
Process exited with code 255.
Output for 7.3.0 - 7.3.33, 7.4.0 - 7.4.26
Parse error: syntax error, unexpected 'Foo' (T_STRING) in /in/ECh4o on line 3
Process exited with code 255.

preferences:
61.95 ms | 1033 KiB | 4 Q