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

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

ginnerpeace/php-enum
====================

This class gives the ability to emulate and get enumeration data natively in PHP.

v1.8(5y ago)35.5k1MITPHPPHP ^5.6|^7.0|^8.0CI failing

Since Jul 12Pushed 4y ago1 watchersCompare

[ Source](https://github.com/jay-youngn/php-enum)[ Packagist](https://packagist.org/packages/ginnerpeace/php-enum)[ Docs](https://github.com/ginnerpeace/php-enum)[ RSS](/packages/ginnerpeace-php-enum/feed)WikiDiscussions master Synced today

READMEChangelog (3)Dependencies (1)Versions (9)Used By (0)

php-enum
========

[](#php-enum)

[![Total Downloads](https://camo.githubusercontent.com/6a0d474385b50c73cc78834eafaad3e9982821da8798c3b644130d9a9fe3d72f/68747470733a2f2f706f7365722e707567782e6f72672f67696e6e657270656163652f7068702d656e756d2f646f776e6c6f6164732e737667)](https://packagist.org/packages/ginnerpeace/php-enum)[![Latest Stable Version](https://camo.githubusercontent.com/e04c1b0c6b671f1c10ced96a137f274cecd804e5a98f82ab92b503b2e58554b9/68747470733a2f2f706f7365722e707567782e6f72672f67696e6e657270656163652f7068702d656e756d2f762f737461626c652e737667)](https://packagist.org/packages/ginnerpeace/php-enum)[![Latest Unstable Version](https://camo.githubusercontent.com/806a278bbc9ab1567ccc4db47eef9447e88fc2620d3bbcf611bfc53d498c2afa/68747470733a2f2f706f7365722e707567782e6f72672f67696e6e657270656163652f7068702d656e756d2f762f756e737461626c652e737667)](https://packagist.org/packages/ginnerpeace/php-enum)[![License](https://camo.githubusercontent.com/1b8e63d9a2ae0ca6ab3fe432752ad638a88873f1e634dab644c0a5797973bbf8/68747470733a2f2f706f7365722e707567782e6f72672f67696e6e657270656163652f7068702d656e756d2f6c6963656e73652e737667)](https://packagist.org/packages/ginnerpeace/php-enum)

> This class gives the ability to emulate and get enumeration data natively in PHP.

- You can convert enum values easily.
- requires php&gt;=5.6.0, because array constant are used.

Getting started
---------------

[](#getting-started)

### Install

[](#install)

```
composer require ginnerpeace/php-enum
```

### Example

[](#example)

Create a class for an enum data, like this:

```
