Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:49463 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 9686 invoked from network); 19 Aug 2010 16:53:45 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Aug 2010 16:53:45 -0000 Authentication-Results: pb1.pair.com header.from=smalyshev@sugarcrm.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=smalyshev@sugarcrm.com; spf=pass; 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:37385] helo=smtp123.dfw.emailsrvr.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id B3/71-00261-8916D6C4 for ; Thu, 19 Aug 2010 12:53:44 -0400 Received: from relay22.relay.dfw.mlsrvr.com (localhost [127.0.0.1]) by relay22.relay.dfw.mlsrvr.com (SMTP Server) with ESMTP id 9A228C0817D; Thu, 19 Aug 2010 12:53:41 -0400 (EDT) Received: by relay22.relay.dfw.mlsrvr.com (Authenticated sender: smalyshev-AT-sugarcrm.com) with ESMTPSA id 444EFC0814F; Thu, 19 Aug 2010 12:53:41 -0400 (EDT) Message-ID: <4C6D6194.6010202@sugarcrm.com> Date: Thu, 19 Aug 2010 09:53:40 -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: Dave Ingram CC: PHP Internals References: <4C6CE273.2070501@sugarcrm.com> <4C6CE604.1010209@dmi.me.uk> <4C6CE793.1020601@sugarcrm.com> <4C6CEBE4.3070306@dmi.me.uk> In-Reply-To: <4C6CEBE4.3070306@dmi.me.uk> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] inheritance check too strict? From: smalyshev@sugarcrm.com (Stas Malyshev) Hi! > Maybe I didn't express myself clearly: I meant that the arguments in the > child's signature must be a superset of the arguments in the parent > signature, in the same order. Any required arguments in the parent may It was clear to me you said that, however it is in no way clear why it must be so. LSP requires that any code that calls ObjParent could also call ObjChild, this is true. It does not say anything about supersets - it only says that preconditions should not be strengthened, and that's exactly what happens. > I'm assuming that the parameter would cause variations in behaviour > (which is generally the reason for having parameters), so by definition > ignoring it would cause different behaviour. I presume that this would > be unexpected. Again, you are assuming behavior which has nothing to do with signatures. This way we had to disallow overriding at all - because somebody could write the overriding code that just ignores parameters and always returns 42! Behavior that is written into the code is of course expected, it's why it is there. > Arguments being silently ignored sounds like a potential bug to me. I > know it's something I've seen in code I've maintained. No, it's not a bug - extra arguments were silently ignored in PHP since the dawn of time. -- Stanislav Malyshev, Software Architect SugarCRM: http://www.sugarcrm.com/ (408)454-6900 ext. 227