PHPackages                             jayzeng/php-enum - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. jayzeng/php-enum

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

jayzeng/php-enum
================

PHP enum class that OO way to manipulate enums

0.2(13y ago)0892MITPHPPHP &gt;=5.3.0

Since Mar 1Pushed 12y ago1 watchersCompare

[ Source](https://github.com/jayzeng/PHPEnum)[ Packagist](https://packagist.org/packages/jayzeng/php-enum)[ Docs](https://github.com/jayzeng/PHPEnum.git)[ RSS](/packages/jayzeng-php-enum/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (1)Versions (5)Used By (0)

PHP Enum
========

[](#php-enum)

[![Latest Stable Version](https://camo.githubusercontent.com/bffb85462839c93615e0c821fc976894db8763d19e377d34b4a97a3d1e746759/68747470733a2f2f706f7365722e707567782e6f72672f6a61797a656e672f7068702d656e756d2f762f737461626c652e706e67)](https://packagist.org/packages/jayzeng/php-enum) [![Total Downloads](https://camo.githubusercontent.com/03dc768522cc2c6fc55b50f2904dc5149258d984bafb4467559999a5a2d107c1/68747470733a2f2f706f7365722e707567782e6f72672f6a61797a656e672f7068702d656e756d2f646f776e6c6f6164732e706e67)](https://packagist.org/packages/jayzeng/php-enum)[![Build Status](https://camo.githubusercontent.com/84c7ce49affb595c89c2f99811f891aa2dfc8f57c0b8d1bb57fe1baf04f38c1f/68747470733a2f2f7472617669732d63692e6f72672f6a61797a656e672f504850456e756d2e706e67)](https://travis-ci.org/jayzeng/PHPEnum)

Project website: ()

\##Usage:

```
class StubUtilEnum extends Enum
{
    const ONE   = 1;
    const TWO   = 2;
    const THREE = 3;
    const FOUR  = "four";
}

// Retrieve value mapped to the label
$StubUtilEnum->getValue('ONE');   // returns 1
$StubUtilEnum->getValue('FOUR');   // returns four
$StubUtilEnum->getValues();    //  array

// Determine if a label exists
$StubUtilEnum->hasLabel(1);         // true
$StubUtilEnum->hasLabel('oops');    // false
```

\##Details See

\##Issues &amp; Development

- Source hosted [GitHub](https://github.com/jayzeng/PHPEnum)
- Report issues, questions, feature requests on [GitHub Issues](https://github.com/jayzeng/PHPEnum/issues)

\##How to release new version?

- RELEASE\_VERSION - version number
- RELEASE\_MESSAGE - release message

```
make release RELEASE_VERSION="0.1" RELEASE_MESSAGE="v0.1 is released"
```

\##Author: [Jay Zeng](https://github.com/jayzeng/), e-mail:

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

4822d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/08b89f14c74d6d6ba225fe3b29d360ba509116763d4d906991eb9f665cc02091?d=identicon)[jayzeng](/maintainers/jayzeng)

---

Top Contributors

[![jayzeng](https://avatars.githubusercontent.com/u/141891?v=4)](https://github.com/jayzeng "jayzeng (9 commits)")

---

Tags

enumutil

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/jayzeng-php-enum/health.svg)

```
[![Health](https://phpackages.com/badges/jayzeng-php-enum/health.svg)](https://phpackages.com/packages/jayzeng-php-enum)
```

###  Alternatives

[myclabs/php-enum

PHP Enum implementation

2.7k227.9M637](/packages/myclabs-php-enum)[dasprid/enum

PHP 7.1 enum implementation

379146.0M11](/packages/dasprid-enum)[spatie/enum

PHP Enums

84429.1M68](/packages/spatie-enum)[marc-mabe/php-enum

Simple and fast implementation of enumerations with native PHP

49444.8M97](/packages/marc-mabe-php-enum)[spatie/laravel-enum

Laravel Enum support

3655.4M31](/packages/spatie-laravel-enum)[consistence/consistence

Consistence - consistent approach and additions to PHP's functionality

1831.1M18](/packages/consistence-consistence)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
