How do I correct syntax highlight in VS Code for PHP 8.1 Enum Class?

Open Visual Studio Code settings and ensure the intelephense.environment.phpVersion directive is set to "8.1.0". It can be set for the whole program or for specific projects.

intelephense.environment.phpVersion

{
    "intelephense.environment.phpVersion": "8.1.0"
}