PHP/native/BackedEnum

from HTYP, the free directory anyone can edit if they can prove to me that they're not a spambot
< PHP
Revision as of 20:08, 23 August 2024 by Woozle (talk | contribs) (Created page with "{{fmt/title|BackedEnum pseudointerface}} * '''manual page''': [https://www.php.net/manual/en/class.backedenum.php The BackedEnum interface] Note that this cannot actually be...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
BackedEnum pseudointerface

Note that this cannot actually be implemented as a class, except by declaring a backed enum.

Definition

interface BackedEnum extends UnitEnum {
/* Methods */
   static from(int|string $value): static;
   static tryFrom(int|string $value): ?static;

   string|int $value; // unofficial

/* Inherited */
   static UnitEnum::cases(): array;
   static cases(): array;

   string $name; // unofficial
}