Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:55486 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 13434 invoked from network); 17 Sep 2011 18:08:53 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 Sep 2011 18:08:53 -0000 Authentication-Results: pb1.pair.com smtp.mail=smalyshev@sugarcrm.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=smalyshev@sugarcrm.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain sugarcrm.com designates 67.192.241.143 as permitted sender) X-PHP-List-Original-Sender: smalyshev@sugarcrm.com X-Host-Fingerprint: 67.192.241.143 smtp143.dfw.emailsrvr.com Linux 2.6 Received: from [67.192.241.143] ([67.192.241.143:47825] helo=smtp143.dfw.emailsrvr.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id DA/76-05466-332E47E4 for ; Sat, 17 Sep 2011 14:08:53 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp24.relay.dfw1a.emailsrvr.com (SMTP Server) with ESMTP id 0FA49180491; Sat, 17 Sep 2011 14:08:49 -0400 (EDT) X-Virus-Scanned: OK Received: by smtp24.relay.dfw1a.emailsrvr.com (Authenticated sender: smalyshev-AT-sugarcrm.com) with ESMTPSA id 32B35180417; Sat, 17 Sep 2011 14:08:48 -0400 (EDT) Message-ID: <4E74E22F.1070203@sugarcrm.com> Date: Sat, 17 Sep 2011 11:08:47 -0700 Organization: SugarCRM User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:6.0.2) Gecko/20110902 Thunderbird/6.0.2 MIME-Version: 1.0 To: Etienne Kneuss CC: Laruence , "devis@lucato.it" , "internals@lists.php.net" , "RQuadling@gmail.com" , Nikita Popov References: In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] __constructor parameter limitations. From: smalyshev@sugarcrm.com (Stas Malyshev) Hi! > On Sat, Sep 17, 2011 at 17:08, Laruence 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