Skip to content

Enums for PHP

Runtime Release License Downloads Coverage Build

Yet another implementation of enumerated types

This implementation, based on traits, gives a set of static methods to ease working with the public constants of a class representing an enumerated type.

Unlike other PHP implementations, like the SplEnum class, it does not rely on object instances.

Quick start

Install the latest version of Enums for PHP with Composer:

composer require cedx/enum

For detailed instructions, see the installation guide.