3v4l.org

run code in 300+ PHP versions simultaneously
<?php enum A: string { case B = 'b'; case C = 'c'; } $b = 'b'; $val = A::from($b); var_dump($val);
Output for 8.1rc1 - rc2
enum(A::B)
Output for 8.0.0 - 8.0.11
Parse error: syntax error, unexpected identifier "A" in /in/2GaEv on line 3
Process exited with code 255.
Output for 7.3.0 - 7.3.31, 7.4.0 - 7.4.24
Parse error: syntax error, unexpected 'A' (T_STRING) in /in/2GaEv on line 3
Process exited with code 255.

preferences:
34.03 ms | 458 KiB | 5 Q