PackageTrack
Sign in Get early access

konekt/enum

SPL inspired PHP enum class implementation

4.2.1 2.5M downloads/mo #2185 most downloaded on Packagist artkonekt/enum

What this package is like to depend on

Last release 4 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

1 release in the last 12 months

see the full history below

Release timeline

21 releases · May 2016 to Apr 2026
2017 2018 2019 2020 2021 2022 2023 2024 2025 2026
Release Pre-release

Releases

latest 21
  1. 4.2.1 24 Apr 2026
    Release notes
    2026-04-24
    • Added the missing ctype extension dependency to the composer.json
    • Tested and works with PHP 8.4 & 8.5
    Open source →
  2. 4.2.0 29 Feb 2024
    Release notes
    2024-02-29
    • Tested and works with PHP 8.3
    • Added the isAnyOf(), isNoneOf() and doesNotEqualTo() comparison methods
    • Added the following methods to the EnumInterface:
      • equals()
      • doesNotEqualTo()
      • isAnyOf()
      • isNoneOf()
    Open source →
  3. 4.1.0 07 Jun 2023
    Release notes
    2023-06-07
    • Added the EnumInterface (contains most public v4 enum methods); the Enum class implements it
    Open source →
  4. 4.0.2 17 Feb 2023
    Release notes
    2023-02-17
    • Tested and works with PHP 8.2
    Open source →
  5. 4.0.1 11 Mar 2022
    Release notes
    2022-03-11
    • Improved the details of the error message on unknown value errors
    Open source →
  6. 4.0.0 10 Mar 2022
    Release notes
    2022-03-10

    See the complete Upgrade Guide in the Documentation

    • Dropped PHP 7.3 and PHP 7.4 support
    • BC: Using strict comparison internally everywhere, consequences:
      • types are now type sensitive,
      • "2" != 2
      • null != 0
      • if you can do: YourEnum::create("2") then you can't YourEnum::create(2)
    • Added the feature to create enums that have a null value but the default is not the null one.
    • Changed the internals to utilize streamlined PHP 8 features
    • Changed the internal implementation to use argument and return types everywhere
    • Changed the git attributes so that the test suite, docs and other helper files aren't exported in the vendor folder

    3.x

    Open source →
  7. 3.1.1 30 Sep 2021
    Release notes
    2021-09-30
    • Fixed magic comparison getter/method in case there were numerical parts in the const name
    • Tested and works with PHP 8.1
    • Replaced Travis CI with Github Actions
    Open source →
  8. 3.1.0 28 Nov 2020
    Release notes
    2020-11-28
    • Dropped PHP 7.1 and 7.2 support
    • Added PHP 8 support
    • Adopted PSR-12 Coding style (internally)
    Open source →
  9. 3.0.0 24 Jun 2019
    Release notes
    2019-06-24
    • The __default const has been renamed to __DEFAULT for full PSR-1 compliance.
    • It is possible to set fallback to default for unknown values.
    • Rest of features are equivalent to v2.2.0.
    • PHP 7.0 support has been dropped.
    • Early PHP 7.4 support (as-is - since it hasn't been released yet).

    2.x

    Open source →
  10. 2.3.0 25 Jun 2019
    Release notes
    2019-06-25
    • It is possible to set fallback to default for unknown values (Backport from 3.0)
    • Tested against early version of PHP 7.4
    Open source →
  11. 2.2.0 14 Feb 2019
    Release notes
    2019-02-14
    • The notEquals() comparison method has been added.
    • Tested with PHP 7.3 (has been working with earlier versions as well)
    Open source →
  12. 2.1.1 09 Jun 2018
    Release notes
    2018-06-09
    • Minor fix: triggering the proper E_USER_WARNING error on unknown method call.
    • Documentation improved: jump to top when changing page
    • Broader PHPUnit support, testing with php 7.2 as well on travis
    Open source →
  13. 2.1.0 13 Oct 2017
    Release notes
    2017-10-13 (Friday 🎃)
    Open source →
  14. 2.0.2 26 Sep 2017
    Release notes
    2017-09-26
    • defaultValue() static method has been added
    Open source →
  15. 2.0.1 14 Sep 2017
    Release notes
    2017-09-14
    • reset() method has been added
    Open source →
  16. 2.0.0 13 Sep 2017
    Release notes
    2017-09-13
    • Rewritten from scratch
    • API has changed completely, with clarity as primary scope
    • Minimum PHP version is 7.0
    • Strict mode removed
    • equals() does type check
    • For more details refer to Upgrade from v1 to v2
    2017-09-06

    Development of v2 has been started.

    1.x

    Open source →
  17. 1.2.0 14 Dec 2016
    Release notes
    2016-12-14
    • Display texts can be fetched dynamically via callback method
    Open source →
  18. 1.1.0 06 Jul 2016
    Release notes
    2016-07-06
    • Support for display texts has been added
    • BC: __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.
    • Changelog started (added all backwards versions beginning from 1.0.0
    Open source →
  19. 1.0.2 31 May 2016
    Release notes
    2016-05-31
    • Static method bugfix
    Open source →
  20. 1.0.1 30 May 2016
    Release notes
    2016-05-30 2
    • Readme updates
    Open source →
  21. 1.0.0 30 May 2016
    Release notes
    2016-05-30
    • Initial release based on konekt/comon v0.1.2, heavily refactored version
    Open source →

Every package, every release, already written down.

The archive is open and free. Watching your own project is what we are building next.

Browse the archive