Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:35870 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 31956 invoked by uid 1010); 1 Mar 2008 13:57:21 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 31941 invoked from network); 1 Mar 2008 13:57:20 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 1 Mar 2008 13:57:20 -0000 Authentication-Results: pb1.pair.com smtp.mail=helly@php.net; spf=unknown; sender-id=unknown Authentication-Results: pb1.pair.com header.from=helly@php.net; sender-id=unknown Received-SPF: unknown (pb1.pair.com: domain php.net does not designate 85.214.94.56 as permitted sender) X-PHP-List-Original-Sender: helly@php.net X-Host-Fingerprint: 85.214.94.56 aixcept.net Linux 2.6 Received: from [85.214.94.56] ([85.214.94.56:42162] helo=h1149922.serverkompetenz.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id D2/85-17741-EB069C74 for ; Sat, 01 Mar 2008 08:57:19 -0500 Received: from MBOERGER-ZRH.corp.google.com (228-213.0-85.cust.bluewin.ch [85.0.213.228]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by h1149922.serverkompetenz.net (Postfix) with ESMTP id 25F0D11F433; Sat, 1 Mar 2008 14:57:15 +0100 (CET) Date: Sat, 1 Mar 2008 14:56:49 +0100 Reply-To: Marcus Boerger X-Priority: 3 (Normal) Message-ID: <1626191658.20080301145649@marcus-boerger.de> To: Christian Schneider CC: Stanislav Malyshev , internals Mailing List In-Reply-To: <81270253.20080301135339@marcus-boerger.de> References: <47C84070.2030708@cschneid.com> <47C8448C.70901@zend.com> <81270253.20080301135339@marcus-boerger.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: Re: [PHP-DEV] OO Parameter Checking From: helly@php.net (Marcus Boerger) Hello Christian, Saturday, March 1, 2008, 1:53:39 PM, you wrote: > Hello Christian, Stanislav, > Friday, February 29, 2008, 6:44:44 PM, you wrote: >> Hi! >>> 1) The current checks are IMHO too strict regarding default values for >>> parameters: An inheriting class can add default values to a parameter >>> without breaking the protocol: >>> class A { function foo($x) { ... } } >>> class B extends A { function foo($x = 42) { ... } } >>> should be allowed. Only if there are fewer parameters in B::foo or if >> I think this makes sense. In fact, if B::foo() has less parameters it >> might be OK too, since B would just ignore extra parameters (and in fact >> it could do it anyway :) > Sounds fine to me. > Originally I thought of allowing fully correct protocol checks that would > have allowed to even change the type hints, as long as all rules are > followed. But we decided against this and instead went with a very strict > approach. Maybe it is time to limit the strictness and apply that part of > the patch. Johannes, who is sitting next to me, wrote a test and committed that part. Best regards, Marcus