views:

42

answers:

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

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

+3  A: 

childClass::customMethod() has different arguments, or a different access level (public/private/protected) than parentClass::customMethod().

notJim
probably its because the _visibility_, methods signature isn't an issue in PHP
Gabriel Sosa
Having the same exact argument default values is important as well. For example, `parentClass::customMethod($thing = false)` and `childClass::customMethod($thing)` would trigger the error, because the child's method hasn't defined a default value for the first argument.
Charles
I believe visibility is actually a different error. By the way, at my shop we don't use strict mode, because of this (we use E_ALL, IIRC).
notJim