Difference between revisions of "PHP/enum"

from HTYP, the free directory anyone can edit if they can prove to me that they're not a spambot
< PHP
Jump to navigation Jump to search
(Created page with "{{fmt/title|PHP enum support}} ==Methods== {| class="wikitable sortable" |- ! method || defined |- | public static [https://www.php.net/manual/en/unitenum.cases.php cases]():...")
 
Line 11: Line 11:
 
| public static from(int ''or'' string $value): static || BackedEnum
 
| public static from(int ''or'' string $value): static || BackedEnum
 
|}
 
|}
==Interfaces==
+
==Documentation==
 +
* Enumerations:
 +
** [https://www.php.net/manual/en/language.types.enumerations.php variable type]
 +
** [https://www.php.net/manual/en/language.enumerations.php Enumerations language reference]
 
* [https://www.php.net/manual/en/class.unitenum.php <code>UnitEnum</code>]
 
* [https://www.php.net/manual/en/class.unitenum.php <code>UnitEnum</code>]
 
* [https://www.php.net/manual/en/class.backedenum.php <code>BackedEnum</code>]
 
* [https://www.php.net/manual/en/class.backedenum.php <code>BackedEnum</code>]

Revision as of 19:18, 8 April 2023

PHP enum support

Methods

method defined
public static cases(): array UnitEnum
public static tryFrom(int or string $value): ?static BackedEnum
public static from(int or string $value): static BackedEnum

Documentation