PHP/enum: Difference between revisions
from HTYP, the free directory anyone can edit if they can prove to me that they're not a spambot
< PHP
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]():..." |
No edit summary |
||
| Line 11: | Line 11: | ||
| public static from(int ''or'' string $value): static || BackedEnum | | public static from(int ''or'' string $value): static || BackedEnum | ||
|} | |} | ||
== | ==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
|
{{#set: page title=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
- Enumerations:
UnitEnumBackedEnum
