php / 8.1.5 / class.unitenum.html /

The UnitEnum interface

Introduction

(PHP 8 >= 8.1.0)

The UnitEnum interface is automatically applied to all enumerations by the engine. It may not be implemented by user-defined classes. Enumerations may not override its methods, as default implementations are provided by the engine. It is available only for type checks.

Interface synopsis

interface UnitEnum {
/* Methods */
public static cases(): array
}

Table of Contents

© 1997–2021 The PHP Documentation Group
Licensed under the Creative Commons Attribution License v3.0 or later.
https://www.php.net/manual/en/class.unitenum.php