Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:49505 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 95768 invoked from network); 25 Aug 2010 06:22:20 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 25 Aug 2010 06:22:20 -0000 Authentication-Results: pb1.pair.com header.from=lester@lsces.co.uk; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=lester@lsces.co.uk; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain lsces.co.uk from 213.123.20.128 cause and error) X-PHP-List-Original-Sender: lester@lsces.co.uk X-Host-Fingerprint: 213.123.20.128 c2bthomr10.btconnect.com Received: from [213.123.20.128] ([213.123.20.128:6020] helo=c2bthomr10.btconnect.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id EC/9E-34028-896B47C4 for ; Wed, 25 Aug 2010 02:22:18 -0400 Received: from [10.0.0.4] (host81-138-11-136.in-addr.btopenworld.com [81.138.11.136]) by c2bthomr10.btconnect.com with ESMTP id GAS08026; Wed, 25 Aug 2010 07:22:10 +0100 (BST) X-Mirapoint-IP-Reputation: reputation=Neutral-1, source=Queried, refid=0001.0A0B0302.4C74B692.01F9, actions=tag Message-ID: <4C74B692.2010609@lsces.co.uk> Date: Wed, 25 Aug 2010 07:22:10 +0100 User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.10) Gecko/20100506 SUSE/2.0.5-1.2 SeaMonkey/2.0.5 MIME-Version: 1.0 To: PHP internals References: <1282674464.3333.119.camel@guybrush> In-Reply-To: <1282674464.3333.119.camel@guybrush> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Junkmail-Status: score=10/50, host=c2bthomr10.btconnect.com X-Junkmail-SD-Raw: score=unknown, refid=str=0001.0A0B0207.4C74B696.00D6,ss=1,fgs=0, ip=0.0.0.0, so=2009-07-20 21:54:04, dmn=5.7.1/2009-08-27, mode=single engine X-Junkmail-IWF: false Subject: Re: [PHP-DEV] [PATCH] #52563: Adding E_NONE and/or E_EVERYTHING constants From: lester@lsces.co.uk (Lester Caine) Johannes Schlüter wrote: > On Tue, 2010-08-24 at 18:49 +0800, Adam Harvey wrote: >> Johannes has pointed out on IRC that E_NONE does already exist in some >> projects, so that's an argument against it. > > Yeah, I did a quick code search, which gave some results defining a > constant with that name. This means adding this in 5.3 would be a > annoyance and upgrading from X.Y.(Z-1) to X.Y.Z should be a no > brainer ... on the other hand the fact that people are defining such a > constant and the bug report show that there is some need. > > I myself don't see a point in a constant for an empty bit mask. As an > empty bit mask means 0 ... on the other hand it doesn't cost us much. > > So, I'm +/- 0 on this for trunk. 'a quick code search' for '0' is not going to produce anything sensible, while a quick code search for 'E_NONE' will (in theory) pick up all the places where that particular setting is used. So there IS some sensible reason to add 'pointless' constants. The problem is - it only works if people DO use it consistently ... Given that many people are not used to the maze of code, improving navigability by adding consistent 'pointless' constants could potentially help a lot, even if the constant is simply added as a comment where a check for 0 does not actually need the value? -- Lester Caine - G8HFL ----------------------------- Contact - http://lsces.co.uk/wiki/?page=contact L.S.Caine Electronic Services - http://lsces.co.uk EnquirySolve - http://enquirysolve.com/ Model Engineers Digital Workshop - http://medw.co.uk// Firebird - http://www.firebirdsql.org/index.php