3v4l.org

run code in 300+ PHP versions simultaneously
<?php enum Test: string { public const ENUM_VALUE = 'ENUM_VALUE'; case ENUM = self::ENUM_VALUE; } var_dump(Test::ENUM->value);
Output for 8.1.0 - 8.1.8, 8.2.0 - 8.2.14
string(10) "ENUM_VALUE"
Output for 8.0.1 - 8.0.30
Parse error: syntax error, unexpected identifier "Test" in /in/tImgH on line 4
Process exited with code 255.
Output for 7.4.0 - 7.4.30
Parse error: syntax error, unexpected 'Test' (T_STRING) in /in/tImgH on line 4
Process exited with code 255.

preferences:
201.19 ms | 1405 KiB | 70 Q