note 98646 added to language.oop5.static
| From: | Anonymous at osu1 dot php dot net | Date: | Tue, 29 Jun 2010 01:49:55 +0000 |
| Subject: | note 98646 added to language.oop5.static | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-170535@lists.php.net to get a copy of this message | ||
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.)
----
Server IP: 69.147.83.197
Probable Submitter: 203.26.177.2
----
Manual Page -- http://www.php.net/manual/en/language.oop5.static.php
Edit -- https://master.php.net/note/edit/98646
Del: integrated -- https://master.php.net/note/delete/98646/integrated
Del: useless -- https://master.php.net/note/delete/98646/useless
Del: bad code -- https://master.php.net/note/delete/98646/bad+code
Del: spam -- https://master.php.net/note/delete/98646/spam
Del: non-english -- https://master.php.net/note/delete/98646/non-english
Del: in docs -- https://master.php.net/note/delete/98646/in+docs
Del: other reasons-- https://master.php.net/note/delete/98646
Reject -- https://master.php.net/note/reject/98646
Search -- https://master.php.net/manage/user-notes.php