Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:54640 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 54017 invoked from network); 16 Aug 2011 21:57:29 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 Aug 2011 21:57:29 -0000 Authentication-Results: pb1.pair.com smtp.mail=tyra3l@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=tyra3l@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.213.170 as permitted sender) X-PHP-List-Original-Sender: tyra3l@gmail.com X-Host-Fingerprint: 209.85.213.170 mail-yx0-f170.google.com Received: from [209.85.213.170] ([209.85.213.170:36289] helo=mail-yx0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 1F/50-50859-6C7EA4E4 for ; Tue, 16 Aug 2011 17:57:27 -0400 Received: by yxk30 with SMTP id 30so334747yxk.29 for ; Tue, 16 Aug 2011 14:57:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=y81Ry+XYIGBB3jFXHeeiTNmCP9ALUroTEcFc9P6YBso=; b=O/4hso6xu5qVzjk7PDWCij11OddskkjiH6AH9zTQS81Kb0gnU6HSk6Maa3VIH0kmgb KupQT+R5uJGmc19xSge7R7xaH7fdT3R2BZ9xNzcdsSVJZz6BdUfK5n3ZZjqGk3TaE19U zRautV/iqQLEYxwPgzlLZw6ymXPaCLyZgg1EI= MIME-Version: 1.0 Received: by 10.236.154.42 with SMTP id g30mr776113yhk.236.1313531843086; Tue, 16 Aug 2011 14:57:23 -0700 (PDT) Received: by 10.146.168.9 with HTTP; Tue, 16 Aug 2011 14:57:22 -0700 (PDT) In-Reply-To: <4BB7519F.6070900@smashlabs.com> References: <4BB4EC2F.1020502@smashlabs.com> <4BB65BDE.2040302@zend.com> <4BB7519F.6070900@smashlabs.com> Date: Tue, 16 Aug 2011 23:57:22 +0200 Message-ID: To: Ralph Schindler Cc: Stanislav Malyshev , internals Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] On constructors: BC Break and Class compiler Improvements From: tyra3l@gmail.com (Ferenc Kovacs) On Sat, Apr 3, 2010 at 4:33 PM, Ralph Schindler wrote= : > Stanislav Malyshev wrote: >> >> Hi! >> >>> class Filter { >>> public function __construct() { /* construct stuff */ } >>> public function filter($value) { /* return filtered */ } >>> } >>> >>> Produces: >>> >>> PHP Strict Standards: Redefining already defined constructor for >>> class Zend\Filter\Filter in [snip file] on line [snip line] >> >> I just checked - this code produces the same warning in 5.2 (without the >> namespace of course), and in 5.3.0. So I don't see what changed in 5.3.1 >> exactly? > > Nothing changed, you are right, the behavior is there in all these versio= ns. > > My PHP's for 5.3.0 and 5.3.1&2 have different default values for > error_reporting, and since changing to E_STRICT at runtime is too late (f= ile > already compiled with error_reporting of php.ini), I was not triggering t= he > code properly. > > (My 5.3.0 was shipped from apple, as was their php.ini which the default > error_reporting value is E_ALL & ~E_NOTICE & ~E_DEPRECATED, not the newly > recommended php.ini-development value of E_ALL | E_STRICT. =C2=A0Also, in= 5.2 > series, the PHP group never recommended to use E_STRICT in the php.ini, > another reason the code was not triggered in my testing.) > > -ralph > sorry for resurrecting this thread: I've had a discussion about this change recently, and I re-read the whole thread to refresh my memories. did I miss something, or did we really introduce this BC break based on a "bogus" report? I mean, based on Ralph's last email, it seems that the reported warning was present in all previous versions, and the problem has nothing to do with namespaces. btw. I tried to reproduce the problem now, but the E_STRICT only triggered, if I swapped the order of the __construct and filter definition, which seems logical, cause if we have the __construct first, then the classname ctor cannot override that(only the other way around supported). I looked around, and I found out that this change was introduced by Felipe: https://bugs.php.net/bug.php?id=3D52160 he basically implemented Ralphs original patch/suggestion on his own. does anybody else thinks that this is a good example what/how not to do thi= ngs? ps: Andi mentioned in this thread that we should mark the classname ctors deprecated with the next version, if we want that, now is the time. --=20 Ferenc Kov=C3=A1cs @Tyr43l - http://tyrael.hu