PHP 8

The PHP RFC for enumerations just passed a 44-7 vote to be accepted as a new feature in the upcoming PHP 8.1 release!

Enumerations, also known as "enums", are a special data type that can only contain specific, predefined (or "enumerated") values. They behave somewhat similar to constants, in that their names can be referenced in code, but they allow for stronger typing.

The classic use case illustrated by the RFC is of an enum that defines different suits of playing cards: