其他保留字列表

以下关键字不可被用于类名、接口名和trait名,在 PHP 8.0 之前,它们被禁止用于命名空间。

保留字
int float bool string
true false null void(从 PHP 7.1 开始)
iterable(从 PHP 7.1 开始) object(从 PHP 7.2 开始) mixed(从 PHP 8.0 开始) never(从 PHP 8.1 开始)

以下关键词已经被建议保留。尽管你仍然可以将它们用于类名、接口名和 trait 名,但是考虑到在将来的PHP版本中可能会使用,因此非常不推荐去使用它们。

Soft reserved words
enum resource numeric

add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top