php - 方法声明应与 PHP 中的父方法兼容

标签 php methods standards-compliance

Strict Standards: Declaration of childClass::customMethod() should be compatible with that of parentClass::customMethod()

PHP 中出现此错误的可能原因是什么?我在哪里可以找到关于兼容意味着什么的信息?

最佳答案

childClass::customMethod()parentClass::customMethod() 具有不同的参数或访问级别(公共(public)/私有(private)/ protected )。

关于php - 方法声明应与 PHP 中的父方法兼容,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3115388/

相关文章:

C++ 自动实现的函数和 ODR

php - jquery 搜索和替换

php - 使用 php 解压缩 .blend 文件数据的更简单方法?

methods - 需要进行多少次模拟?

c++ - 对象方法的真实地址

c++ - 是否应允许模板模板参数接收从先前参数解析的参数?

php - 如何获取GET请求体

php - 扩展或实现 simplexml 以避免 DRY

c++ - C++ 类中的 Getline

c++ - 为什么使用检测惯用法会导致 Clang 和 GCC 出现不同的编译错误,而 MSVC 则不会出现编译错误