php-src/Zend/zend_enum.stub.php
Ilija Tovilo 269c8dac1d
Implement enums
RFC: https://wiki.php.net/rfc/enumerations

Co-authored-by: Nikita Popov <nikita.ppv@gmail.com>

Closes GH-6489.
2021-03-17 19:08:03 +01:00

16 lines
273 B
PHP

<?php
/** @generate-class-entries */
interface UnitEnum
{
public static function cases(): array;
}
interface BackedEnum extends UnitEnum
{
public static function from(int|string $value): static;
public static function tryFrom(int|string $value): ?static;
}