CakeFest 2024: The Official CakePHP Conference

ReturnTypeWillChange 类

(PHP 8 >= 8.1.0)

简介

大多数非 final 内部方法现在需要重写方法来声明兼容的返回类型,否则在继承验证期间会发出弃用通知。 如果由于 PHP 跨版本兼容性问题而无法为重写方法声明返回类型,可以添加 #[\ReturnTypeWillChange] 属性以消除弃用通知。

类摘要

final class ReturnTypeWillChange {
/* 方法 */
public __construct()
}

参见

注解概览

目录

add a note

User Contributed Notes

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