ID: 50897 User updated by: frederic dot hardy at mageekbox dot net Reported By: frederic dot hardy at mageekbox dot net Status: Open Bug Type: Scripting Engine problem Operating System: * PHP Version: 5.*, 6 New Comment:
lol :). So there is an another problem, __construct() seems to be not checked like other method... It seems to me that there is lot of inconsistency with E_STRICT and method signature checking. Previous Comments: ------------------------------------------------------------------------ [2010-02-01 13:08:06] j...@php.net If you feel it's a problem, don't put E_STRICT in your error_reporting.. ------------------------------------------------------------------------ [2010-02-01 12:27:11] frederic dot hardy at mageekbox dot net Why the notice should be output in all cases ? It's not a problem if b::test() has a signature wich is different from a::test(). If it's a problem, what is the interest of extends b from a, or more globaly, what is the interest of inheritance if you can not override method with different signature ? ------------------------------------------------------------------------ [2010-02-01 12:21:08] j...@php.net And the notice should be output in all cases.. ------------------------------------------------------------------------ [2010-02-01 12:19:49] j...@php.net Yes, but the order should not matter, that was my point. :) ------------------------------------------------------------------------ [2010-02-01 12:08:42] mvalleton at sauf dot ca The problem isn't related with the order in which you declare classes a and b: The warning appears when classes a and b are declared in the *correct* order, but in a different file, and then required by the main script. Here is a simple example: http://ssz.fr/brdl/php-bug-50897.tbz2 classes.php: <?php class a {public function test($foo) {}} class b extends a {public function test($foo, $bar) {}} ?> script.php: <?php error_reporting(E_STRICT); require "classes.php"; $b = new b(); ?> ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/50897 -- Edit this bug report at http://bugs.php.net/?id=50897&edit=1