PHP8 相對(duì)類類型

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 使用了類型聲明的父級(jí)類。

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 起可用。


以上內(nèi)容是否對(duì)您有幫助:
在線筆記
App下載
App下載

掃描二維碼

下載編程獅App

公眾號(hào)
微信公眾號(hào)

編程獅公眾號(hào)