Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:49461 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 6417 invoked from network); 19 Aug 2010 16:42:29 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Aug 2010 16:42:29 -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.123 as permitted sender) X-PHP-List-Original-Sender: smalyshev@sugarcrm.com X-Host-Fingerprint: 67.192.241.123 smtp123.dfw.emailsrvr.com Linux 2.6 Received: from [67.192.241.123] ([67.192.241.123:43254] helo=smtp123.dfw.emailsrvr.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id D3/D0-00261-3FE5D6C4 for ; Thu, 19 Aug 2010 12:42:28 -0400 Received: from relay22.relay.dfw.mlsrvr.com (localhost [127.0.0.1]) by relay22.relay.dfw.mlsrvr.com (SMTP Server) with ESMTP id 0893FC08257; Thu, 19 Aug 2010 12:42:25 -0400 (EDT) Received: by relay22.relay.dfw.mlsrvr.com (Authenticated sender: smalyshev-AT-sugarcrm.com) with ESMTPSA id B4815C082F9; Thu, 19 Aug 2010 12:42:24 -0400 (EDT) Message-ID: <4C6D5EF0.3050109@sugarcrm.com> Date: Thu, 19 Aug 2010 09:42:24 -0700 Organization: SugarCRM User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.1.11) Gecko/20100711 Thunderbird/3.0.6 MIME-Version: 1.0 To: =?UTF-8?B?Sm9oYW5uZXMgU2NobMO8dGVy?= CC: Dave Ingram , PHP Internals References: <4C6CE273.2070501@sugarcrm.com> <4C6CE604.1010209@dmi.me.uk> <4C6CE793.1020601@sugarcrm.com> <1282206735.2561.11.camel@guybrush> In-Reply-To: <1282206735.2561.11.camel@guybrush> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] inheritance check too strict? From: smalyshev@sugarcrm.com (Stas Malyshev) Hi! > class A { > public function foo(Foo $a = null) {} > } > > class B extends A { > public function foo() {} > } > > class C extends B { > public function foo(Bar $a = null) {} > } > > Here B::foo() is compatible with A:foo() and as the parameter is > optional C::foo() is compatible with B::foo(). But C::foo() is no more > compatible with A::foo(). Between B and C there's of course incompatibility - while B accepts anything (and ignores it), C accepts only Bar or nothing. But I was talking between A and B! -- Stanislav Malyshev, Software Architect SugarCRM: http://www.sugarcrm.com/ (408)454-6900 ext. 227