Hi!
On Sat, Sep 17, 2011 at 17:08, Laruence<larue...@php.net> wrote:
class A { public function init($a, $b) { } }
class B extends A { public function init($a) { } }
=> PHP Strict Standards: Declaration of B::init() should be compatible
with
that of A::init()
do you know any reason for this?
The reason for this is simply that B must act like A since every B object is
also an object of A.
This is not a real reason, it's just repeating it. All B is saying in
fact "I'm going to ignore everything but the first parameter", and
there's no real reason not to allow it to do that. There's no "act" that
makes B incompatible with A here, this warning is completely useless.
--
Stanislav Malyshev, Software Architect
SugarCRM: http://www.sugarcrm.com/
(408)454-6900 ext. 227
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php