NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
Packagist · #2850 most downloaded on Packagist
SPL inspired PHP enum class implementation
Last release 5 months ago
24 Apr 2026
Release timing varies
gaps range from 2 weeks to 2.1 years
Nearly every release is documented
notes for 21 of 21 stable releases
Nothing withdrawn
no release was ever pulled
10 years old
21 releases · first in 2016
Added the missing ctype extension dependency to the composer.json
composer.jsonAdded the isAnyOf(), isNoneOf() and doesNotEqualTo() comparison methods
isAnyOf(), isNoneOf() and doesNotEqualTo() comparison methodsEnumInterface:
equals()doesNotEqualTo()isAnyOf()isNoneOf()One column per quarter.
Added the EnumInterface (contains most public v4 enum methods); the Enum class implements it
EnumInterface (contains most public v4 enum methods); the Enum class implements it###### 2023-02-17 - Tested and works with PHP 8.2
Improved the details of the error message on unknown value errors
> See the complete Upgrade Guide in the Documentation
See the complete Upgrade Guide in the Documentation
YourEnum::create("2") then you can't YourEnum::create(2)Fixed magic comparison getter/method in case there were numerical parts in the const name
Dropped PHP 7.1 and 7.2 support
The __default const has been renamed to __DEFAULT for full PSR-1 compliance.
__default const has been renamed to __DEFAULT for full PSR-1 compliance.It is possible to set fallback to default for unknown values (Backport from 3.0)
The notEquals() comparison method has been added.
notEquals() comparison method has been added.Minor fix: triggering the proper E_USER_WARNING error on unknown method call.
E_USER_WARNING error on unknown method call.Magic checker properties and methods have been added
defaultValue() static method has been added
defaultValue() static method has been added###### 2017-09-14 - reset() method has been added
reset() method has been addedAPI has changed completely, with clarity as primary scope
equals() does type checkDevelopment of v2 has been started.
Display texts can be fetched dynamically via callback method
Support for display texts has been added
__toString() casting now takes display text instead of const values. However the result is the very same in case no display text is being used, since it falls back to the const value if no display text is specified.###### 2016-05-31 - Static method bugfix
###### 2016-05-30 2 - Readme updates
Initial release based on konekt/comon v0.1.2, heavily refactored version
Your coding agent can read these notes before it upgrades. Set up the MCP server →