PHP8 相对类类型
2023-08-14 17:09 更新
这些类型声明只能在类中使用。
self
The value must be an instanceof the same class as the one in which the type declaration is used.
parent
值必须是 instanceof 使用了类型声明的父级类。
static
static is a return-only type which requires that the value returned must be an instanceof the same class as the one the method is called in. 自 PHP 8.0.0 起可用。
以上内容是否对您有帮助:
更多建议: