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

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

makhnanov/php-enum
==================

Useful things for new PHP 8.1 Enum feature.

050PHP

Since May 30Pushed 3y ago1 watchersCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

[![Logo](https://github.com/makhnanov/php-enum/raw/main/php-enum-logo.png?raw=true)](https://github.com/makhnanov/php-enum/blob/main/php-enum-logo.png?raw=true)

Introduction
============

[](#introduction)

In [PHP 8.1](https://www.php.net/releases/8.1/en.php) we got [Enumeration](https://www.php.net/manual/en/language.enumerations.php). Thank you, Larry Garfield, Ilija Tovilo, for your [RFC](https://wiki.php.net/rfc/enumerations)!

You can read any overview:

- [How to Use Enums in PHP 8.1](https://www.cloudsavvyit.com/14076/how-to-use-enums-in-php-8-1/)
- [Enum в PHP 8.1 — для чего нужен enum, и как реализован в PHP](https://habr.com/ru/post/541246/)
- [Enum в PHP](https://habr.com/ru/post/314114/)
- [PHP 8.1: Enums (Перечисления)](https://sergeymukhin.com/blog/php-81-enums-perecisleniya)

But I duplicate some info in Basic Enum usage section.

Installation
============

[](#installation)

```
composer require makhnanov/php-enum
```

EnumExtension usage
===================

[](#enumextension-usage)

[extension.php](https://github.com/makhnanov/php-enum/blob/main/Example/extension.php)

```
