Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:19112 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 79242 invoked by uid 1010); 21 Sep 2005 20:35:00 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 79226 invoked from network); 21 Sep 2005 20:35:00 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 21 Sep 2005 20:35:00 -0000 X-Host-Fingerprint: 195.226.6.9 darkcity.gna.ch Linux 2.4/2.6 Received: from ([195.226.6.9:59576] helo=darkcity.gna.ch) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id 84/7F-19329-2F3C1334 for ; Wed, 21 Sep 2005 16:34:58 -0400 Received: from localhost (localhost [127.0.0.1]) by darkcity.gna.ch (Postfix) with ESMTP id AB7771342F4; Wed, 21 Sep 2005 22:34:55 +0200 (CEST) Received: from unknown by localhost (amavisd-new, unix socket) id client-XX3Cx5Sn; Wed, 21 Sep 2005 22:34:54 +0200 (CEST) Received: by darkcity.gna.ch (Postfix, from userid 65534) id 6C44C1342F3; Wed, 21 Sep 2005 22:34:54 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on darkcity.gna.ch X-Spam-Level: ** X-Spam-Status: No, score=2.6 required=5.0 tests=AWL,RCVD_IN_NJABL_DUL, RCVD_IN_SORBS_DUL autolearn=disabled version=3.1.0 Received: from [192.168.1.43] (80-219-12-45.dclient.hispeed.ch [80.219.12.45]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by darkcity.gna.ch (Postfix) with ESMTP id 79D341342EC; Wed, 21 Sep 2005 22:34:48 +0200 (CEST) Message-ID: <4331C46D.9030408@cschneid.com> Date: Wed, 21 Sep 2005 22:37:01 +0200 User-Agent: Mozilla Thunderbird 1.0 (X11/20041207) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Marcus Boerger Cc: internals References: <43317427.8010205@caedmon.net> <1059969811.20050921193002@marcus-boerger.de> In-Reply-To: <1059969811.20050921193002@marcus-boerger.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at gna.ch Subject: Re: [PHP-DEV] E_STRICT on inheritance + method parameter defaults? From: cschneid@cschneid.com (Christian Schneider) Marcus Boerger wrote: > marcus@zaphod /usr/src/PHP_5_1 $ php -r 'class T{function f($x){}} class U extends T{function f($x=2){}}' > make: `sapi/cli/php' is up to date. > > Strict Standards: Declaration of U::f() should be compatible with that of T::f() in Command line code on line 1 > marcus@zaphod /usr/src/PHP_5_1 $ php -r 'class T{function f($x=1){}} class U extends T{function f($x=2){}}' > make: `sapi/cli/php' is up to date. > > The above shows php is correct here. In my opinion Sean didn't ask whether PHP behaves that way but _why_. And I don't really see the point either as U::f works with all code previously using T::f. Even more so for function V::f($x,$y=false) to provide extended functionality to T::f($x) for code which knows about it. And why would changing the default value be ok in your book? But then again I'm not an OO purist and I don't (have to) use E_STRICT. - Chris