Re: __constructor parameter limitations.
| From: | Stas Malyshev | Date: | Sat, 17 Sep 2011 18:08:47 +0000 |
| Subject: | Re: __constructor parameter limitations. | ||
| References: | 1 2 3 4 5 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-55486@lists.php.net to get a copy of this message | ||
Hi!
On Sat, Sep 17, 2011 at 17:08, Laruence<laruence@php.net> wrote: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. 227The reason for this is simply that B must act like A since every B object is also an object of A.withclass A { public function init($a, $b) { } }class B extends A { public function init($a) { } } => PHP Strict Standards: Declaration of B::init() should be compatiblethat of A::init()do you know any reason for this?