note 98646 deleted from language.oop5.static by cmb
| From: | cmb@php.net | Date: | Sun, 01 Sep 2019 07:21:16 +0000 |
| Subject: | note 98646 deleted from language.oop5.static by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-212046@lists.php.net to get a copy of this message | ||
Note Submitter: Anonymous
----
I can't find anything in the PHP manual about this, but the new-ish E_STRICT error reporting
will complain if an inherited class overrides a static method with a different call signature
(usually a parameter list). Ironically, it seems to only be a problem of 'coding style'
because the code works correctly and has done for quite a few versions.
The exact error is "Strict Standards: Declaration of [child-class]::[method]() should be
compatible with that of [parent-class]::[method]()".
So if you must code with E_STRICT enabled, you need to rename the method name.
Google shows that this is biting *a lot* of people. (Bugs have been filed, but there has been no
response yet.)