Re: [PATCH] #52563: Adding E_NONE and/or E_EVERYTHING constants
| From: | Nicolas A. Bérard-Nault | Date: | Wed, 25 Aug 2010 02:38:49 +0000 |
| Subject: | Re: [PATCH] #52563: Adding E_NONE and/or E_EVERYTHING constants | ||
| References: | 1 2 3 4 5 6 7 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-49504@lists.php.net to get a copy of this message | ||
http://thedailywtf.com/Articles/Avoiding-Magic-Constants.aspx
I'm sorry, I could not resist.
On Tue, Aug 24, 2010 at 5:26 PM, Giovanni Giacobbi <giovanni@giacobbi.net>wrote:
> On Tue, Aug 24, 2010 at 11:14:05AM -0700, Stas Malyshev wrote:
> > Hi!
> >
> > >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.
> >
> > What's wrong with using 0? 0 means "nothing", how hard is that? `
>
> Nothing wrong in using 0, but it would be much more elegant to
> stick to constants all from the same family. Someone already
> figured that out:
>
> $ php -r 'print_r(get_defined_constants());' | grep ' 0' | wc -l
> 89
>
> Anyway, my opinion is I would like E_NONE in next major release,
> and I would also like E_ALL to be extended to include E_DEPRECATED and
> E_STRICT, instead of adding a really bogus E_DEVELOPMENT or E_EVERYTHING.
>
> Please also note that E_* indicates a single error channel, with the
> exception of E_ALL and possibly E_NONE if it gets added. I would avoid
> adding more E_* constants which don't represent a single channel. I
> would find it confusing.
>
> 2c
>
> --
> Giovanni Giacobbi
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--
Nicolas A. Bérard-Nault (nicobn@gmail.com)