PHP 8.1 RFC: Enumerations

Enumerations
PHP 8.1
Implemented
Enums

RFC Vote: Enumerations

Implemented
-
>= 2/3
Yes: 44No: 7

Enumerations

TypeNew Feature
Version PHP 8.1

An RFC to add Enumerations (Enums for short) to PHP.

Enums are enumerated types that has a fixed number of possible values. This RFC proposes to add an enum_exists function, two new interfaces for int/string-backed enums, and unit enums.

Subscribe to PHP.Watch newsletter for monthly updates

You will receive an email on last Wednesday of every month and on major PHP releases with new articles related to PHP, upcoming changes, new features and what's changing in the language. No marketing emails, no selling of your contacts, no click-tracking, and one-click instant unsubscribe from any email you receive.