Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:25835 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 15944 invoked by uid 1010); 26 Sep 2006 11:41:28 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 15929 invoked from network); 26 Sep 2006 11:41:28 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 26 Sep 2006 11:41:28 -0000 Authentication-Results: pb1.pair.com header.from=cschneid@cschneid.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=cschneid@cschneid.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain cschneid.com from 195.226.6.42 cause and error) X-PHP-List-Original-Sender: cschneid@cschneid.com X-Host-Fingerprint: 195.226.6.42 darkcity.gna.ch Linux 2.5 (sometimes 2.4) (4) Received: from [195.226.6.42] ([195.226.6.42:33194] helo=mail.gna.ch) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 91/C8-54386-6E119154 for ; Tue, 26 Sep 2006 07:41:28 -0400 Received: from localhost (localhost [127.0.0.1]) by darkcity.gna.ch (Postfix) with ESMTP id 350D92A0D6; Tue, 26 Sep 2006 13:41:24 +0200 (CEST) Received: from unknown by localhost (amavisd-new, unix socket) id client-XXYJ1sGU; Tue, 26 Sep 2006 13:41:20 +0200 (CEST) Received: from [192.168.1.72] (unknown [195.226.9.186]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by darkcity.gna.ch (Postfix) with ESMTP id CDE212A0CF; Tue, 26 Sep 2006 13:41:20 +0200 (CEST) Message-ID: <451911E0.3010609@cschneid.com> Date: Tue, 26 Sep 2006 13:41:20 +0200 User-Agent: Thunderbird 1.5.0.7 (X11/20060911) MIME-Version: 1.0 To: Marcus Boerger CC: PHP Developers Mailing List References: <4511925F.5060602@cschneid.com> <783278347.20060921074613@marcus-boerger.de> In-Reply-To: <783278347.20060921074613@marcus-boerger.de> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: amavisd-new at gna.ch Subject: Re: [PHP-DEV] Parameter checking in 5.2 From: cschneid@cschneid.com (Christian Schneider) Marcus Boerger wrote: > the short form is, use interfaces. And the long form is read the upgrade > file and find out to use interfaces :-) I don't understand how interfaces are connected to my proposal, please explain. Personally I don't need the strict OO checks for matching parameter lists at all, but as long as they are E_STRICT (or the like) I have no problem with them being done. Nevertheless I would like to relax them just a tiny little bit for signature changes not having an impact of object compatibility. That's why I posted two use cases where the checks IMHO go too far and added a patch to change that. Copy of my message: >> In the discussion about parameter checking in 5.2 I proposed to relax >> the checks a tiny little bit: Don't test static functions (e.g. useful >> for factory methods) and allow adding default values to functions (the >> object of the inherited class still accepts the same parameters as the >> base class). A patch is attached. > >> Example: >> class Base >> { >> static function factory($x) { } >> function foo($x) { } >> } > >> class Spezialized extends Base >> { >> static function factory() { } # Static method, e.g. factory method >> function foo($x = null) { } # Default values for specialized class >> } - Chris