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

2021-12-23 00:00:00 methods php standards-compliance
Strict Standards: Declaration of childClass::customMethod() should be compatible with that of parentClass::customMethod()

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

What are possible causes of this error in PHP? Where can I find information about what it means to be compatible?

推荐答案

childClass::customMethod() 有不同的参数,或不同的访问级别(public/private/protected)parentClass::customMethod().

相关文章