Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:45394 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 49141 invoked from network); 25 Aug 2009 13:22:23 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 25 Aug 2009 13:22:23 -0000 Authentication-Results: pb1.pair.com smtp.mail=cschneid@cschneid.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=cschneid@cschneid.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain cschneid.com from 195.226.6.51 cause and error) X-PHP-List-Original-Sender: cschneid@cschneid.com X-Host-Fingerprint: 195.226.6.51 darkcity.gna.ch Linux 2.6 Received: from [195.226.6.51] ([195.226.6.51:40977] helo=mail.gna.ch) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 19/75-22580-C85E39A4 for ; Tue, 25 Aug 2009 09:22:23 -0400 Received: from localhost (localhost [127.0.0.1]) by darkcity.gna.ch (Postfix) with ESMTP id 7C40C116792 for ; Tue, 25 Aug 2009 15:22:17 +0200 (CEST) X-Virus-Scanned: amavisd-new at gna.ch Received: from mail.gna.ch ([127.0.0.1]) by localhost (gna.ch [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id bGl7zObDqTpQ for ; Tue, 25 Aug 2009 15:22:17 +0200 (CEST) Received: from [192.168.1.72] (217-162-207-225.dclient.hispeed.ch [217.162.207.225]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by darkcity.gna.ch (Postfix) with ESMTPSA id CB796116724 for ; Tue, 25 Aug 2009 15:22:16 +0200 (CEST) Message-ID: <4A93E587.7020302@cschneid.com> Date: Tue, 25 Aug 2009 15:22:15 +0200 User-Agent: Thunderbird 2.0.0.22 (X11/20090605) MIME-Version: 1.0 CC: 'PHP Internals' References: <4A92D936.2010107@zend.com> <9E8BD3A3-8915-4492-88A9-7EA1A0CF6D86@prohost.org> <4A92DC60.2050606@zend.com> <4A92EA60.6020605@zend.com> <4A92F13B.9000204@zend.com> <4A92FFA8.1060401@zend.com> <4A9304FC.2000906@sci.fi> <4A930956.9070709@zend.com> <250F0E93-D6F2-490F-9129-598AC6E96500@pooteeweet.org> <4A930D54.6050705@lerdorf.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [patch] error masks From: cschneid@cschneid.com (Christian Schneider) Derick Rethans wrote: > On Mon, 24 Aug 2009, Rasmus Lerdorf wrote: >> Lukas, the problem is that all messages, E_STRICT, E_DEPRECATED, >> E_NOTICE, whatever, all cause a performance hit even if the >> error_reporting level is such that they will never show up anywhere. >> That's what this patch is trying to address. To write optimal code, >> they have to be entirely clean of all messages including E_DEPRECATED >> and E_STRICT. > > And how exactly is that a problem? Sure, there are some cases where PHP > functions are too noisy, but that should be addressed instead. You are making the assumption that everybody agrees on E_NOTICE, E_STRICT and E_DEPRECATED being things to be fixed in your code. That is not the case and punishing people for not following exactly the same coding style as you doesn't make sense when it could easily be avoided. Background info: We decided to patch PHP to not generate E_NOTICE for undefined variables or (worse) array offsets because we use this language feature a lot and cannot afford the overhead caused by E_NOTICEs even if error_reporting is set to ignore E_NOTICE. And you won't be able to convince us to change this policy because being able to do things like if (!$visited[$city]++) is more valuable (i.e. keeps the code uncluttered) to us than the E_NOTICE. We use http://cschneid.com/php/phplint.php (in a commit hook) instead to catch typos. It's not perfect but does the job for us. Summary: Don't punish different coding styles unless really necessary. Cheers, - Chris