PHPackages                             bronos/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. bronos/php-enum

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

bronos/php-enum
===============

PHP Enum

1.0.3(4y ago)06.7k3MITPHPPHP &gt;=7.1

Since Sep 9Pushed 4y ago1 watchersCompare

[ Source](https://github.com/BronOS/php-enum)[ Packagist](https://packagist.org/packages/bronos/php-enum)[ RSS](/packages/bronos-php-enum/feed)WikiDiscussions master Synced 1mo ago

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

PHP Enum implementation
=======================

[](#php-enum-implementation)

[![Build Status](https://github.com/BronOS/php-enum/workflows/build/badge.svg)](https://github.com/BronOS/php-enum/workflows/build/badge.svg)[![Latest Stable Version](https://camo.githubusercontent.com/6810d050654edd56d75c75eaaeb159c1c9beded6031e5defe18d73871e756b49/68747470733a2f2f706f7365722e707567782e6f72672f62726f6e6f732f7068702d656e756d2f76)](//packagist.org/packages/bronos/php-enum)[![Total Downloads](https://camo.githubusercontent.com/c7ce9419d2d8de59ba6eeb4fc8e6b12fd6172a91db804eebe598e5539828121c/68747470733a2f2f706f7365722e707567782e6f72672f62726f6e6f732f7068702d656e756d2f646f776e6c6f616473)](//packagist.org/packages/bronos/php-enum)[![Latest Unstable Version](https://camo.githubusercontent.com/2a55190c30cfb9293d09d0451fe68f34fe4bd906dc6ae4b008a3a63c2459043a/68747470733a2f2f706f7365722e707567782e6f72672f62726f6e6f732f7068702d656e756d2f762f756e737461626c65)](//packagist.org/packages/bronos/php-enum)[![License](https://camo.githubusercontent.com/be9079160afc17dcf2dd87110e107836ffe2798593c71cd52525adba214e899b/68747470733a2f2f706f7365722e707567782e6f72672f62726f6e6f732f7068702d656e756d2f6c6963656e7365)](//packagist.org/packages/bronos/php-enum)[![codecov](https://camo.githubusercontent.com/7d88b52338d60bb0c1d1d7260526aa9c9a61a36f0953ece2591778c7a2e03b24/68747470733a2f2f636f6465636f762e696f2f67682f42726f6e4f532f7068702d656e756d2f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/BronOS/php-enum)

Installation
------------

[](#installation)

```
composer require bronos/php-enum

```

Declaration
-----------

[](#declaration)

```
use BronOS\PhpEnum\ConstEnum;

class MyEnum extends ConstEnum
{
    private const ONE = 1;
    private const TWO = 2;
    private const THREE = 3;
}
```

Usage
-----

[](#usage)

```
$enumOne = MyEnum::ONE(); // $enumOne->getValue() == 1
$enumTwo = MyEnum::TWO(); // $enumTwo->getValue() == 2
$enumTree = new MyEnum(3); // $enumThree->getValue() == 3

$enumOne->getOptionName() == 'ONE';
$enumOne->isEqual(1) == true;
MyEnum::isValid(5) == false;

new MyEnum(4); // EnumException
```

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity52

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 ~118 days

Total

4

Last Release

1721d ago

PHP version history (2 changes)1.0.0PHP &gt;=7.4

1.0.3PHP &gt;=7.1

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/741663?v=4)[Oleg Bronzov](/maintainers/BronOS)[@BronOS](https://github.com/BronOS)

---

Top Contributors

[![BronOS](https://avatars.githubusercontent.com/u/741663?v=4)](https://github.com/BronOS "BronOS (14 commits)")

---

Tags

typeenum

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[phpoption/phpoption

Option Type for PHP

2.7k541.2M159](/packages/phpoption-phpoption)[myclabs/php-enum

PHP Enum implementation

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

Simple and fast implementation of enumerations with native PHP

49444.8M97](/packages/marc-mabe-php-enum)[jetbrains/phpstorm-stubs

PHP runtime &amp; extensions header files for PhpStorm

1.4k27.7M68](/packages/jetbrains-phpstorm-stubs)[dasprid/enum

PHP 7.1 enum implementation

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

PHP Enums

84429.1M68](/packages/spatie-enum)

PHPackages © 2026

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