Re: [PATCH] #52563: Adding E_NONE and/or E_EVERYTHING constants
| From: | Adam Harvey | Date: | Tue, 24 Aug 2010 17:53:21 +0000 |
| Subject: | Re: [PATCH] #52563: Adding E_NONE and/or E_EVERYTHING constants | ||
| References: | 1 2 3 4 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-49494@lists.php.net to get a copy of this message | ||
On 25 August 2010 01:47, Stas Malyshev <smalyshev@sugarcrm.com> wrote:
> You seriously don't know why one needs constants or don't see a difference between
> constant E_WARNING equal to 8 and constant E_NONE meaning "nothing" and equal to 0? How
> about having constants ONE, TWO, THREE, FOUR? Just in case, won't hurt anybody, right? :)
Daily WTF is that way. :)
I didn't lodge the original request, but I thought the reasoning
behind E_NONE was pretty clear: it's pointless, sure, but it visually
lines up with the other E_ constants. At that point, you can just make
the advice when helping out PHP developers on support forums "always
use an E_ constant with error_reporting" and not have the current
situation where sometimes you use a constant (or constants) and
sometimes you use a bare number, depending on what you want to
achieve.
Aside from the potential conflict issue Johannes noted, I thought it
seemed pretty harmless.
Adam