BackedEnum 接口
(PHP 8 >= 8.1.0)
简介
引擎会自动应用 BackedEnum 接口到回退枚举。
用户自定义类不能实现该接口。
由于引擎已提供枚举的默认实现,因此不能重载它的接口。
主要将它用于类型检测。
接口摘要
public static from(
int|string $value
):
static
public static tryFrom(
int|string $value
):
?static
}
目录
There are no user contributed notes for this page.