略微加速

PHP官方手册 - 互联网笔记

PHP - Manual: 相对类类型

2025-02-27

相对类类型

这些类型声明只能在类中使用。

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

添加备注

用户贡献的备注

此页面尚无用户贡献的备注。

官方地址:https://www.php.net/manual/en/language.types.relative-class-types.php

北京半月雨文化科技有限公司.版权所有 京ICP备12026184号-3