Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:19111 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 43565 invoked by uid 1010); 21 Sep 2005 17:30:08 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 43547 invoked from network); 21 Sep 2005 17:30:08 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 21 Sep 2005 17:30:08 -0000 X-Host-Fingerprint: 81.169.182.136 ajaxatwork.net Linux 2.4/2.6 Received: from ([81.169.182.136:44347] helo=strato.aixcept.de) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id B6/4C-19329-99891334 for ; Wed, 21 Sep 2005 13:30:04 -0400 Received: from [192.168.1.3] (dsl-082-083-229-040.arcor-ip.net [82.83.229.40]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by strato.aixcept.de (Postfix) with ESMTP id BA14135C384; Wed, 21 Sep 2005 19:53:28 +0200 (CEST) Date: Wed, 21 Sep 2005 19:30:02 +0200 Reply-To: Marcus Boerger X-Priority: 3 (Normal) Message-ID: <1059969811.20050921193002@marcus-boerger.de> To: Sean Coates Cc: internals In-Reply-To: <43317427.8010205@caedmon.net> References: <43317427.8010205@caedmon.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] E_STRICT on inheritance + method parameter defaults? From: helly@php.net (Marcus Boerger) Hello Sean, Wednesday, September 21, 2005, 4:54:31 PM, you wrote: > Hello all, > This crept up as the result of a bug report (not mine -- > http://bugs.php.net/34494), and a small discussion on IRC: > Why does an E_STRICT get raised when extending a class, and altering the > method's proto defaults? I understand why it would be thrown when > adding/changing parameters, but why when simply changing $foo to $foo=1 ? > Honest question -- I'm not trying to change the behavior, here. It > doesn't seem "correct" to me, but I look forward to an explanation that > I've simply overlooked. > S 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. Best regards, Marcus