Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:49514 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 54804 invoked from network); 25 Aug 2010 13:51:39 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 25 Aug 2010 13:51:39 -0000 Authentication-Results: pb1.pair.com smtp.mail=tyler@n49.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=tyler@n49.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain n49.com designates 216.139.238.141 as permitted sender) X-PHP-List-Original-Sender: tyler@n49.com X-Host-Fingerprint: 216.139.238.141 server5.n49.com Linux 2.5 (sometimes 2.4) (4) Received: from [216.139.238.141] ([216.139.238.141:52224] helo=server5.n49.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C0/72-43011-8EF157C4 for ; Wed, 25 Aug 2010 09:51:38 -0400 Received: from [127.0.0.1] (cmr-208-97-116-42.cr.net.cable.rogers.com [208.97.116.42]) by server5.n49.com (8.13.1/8.13.1) with ESMTP id o7PDpWPu016272 for ; Wed, 25 Aug 2010 09:51:33 -0400 Message-ID: <4C751FD8.8020706@n49.com> Date: Wed, 25 Aug 2010 09:51:20 -0400 User-Agent: Thunderbird 2.0.0.24 (Windows/20100228) MIME-Version: 1.0 To: internals@lists.php.net References: <4C751BDD.3090907@php.net> <4C751E4F.3020901@php.net> In-Reply-To: <4C751E4F.3020901@php.net> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Antivirus: avast! (VPS 100825-0, 25/08/2010), Outbound message X-Antivirus-Status: Clean Subject: Re: [PHP-DEV] [PATCH] #52563: Adding E_NONE and/or E_EVERYTHING constants From: tyler@n49.com (Tyler Lawson) Sebastian Bergmann wrote: > So nobody will use E_DEVELOPMENT or E_NONE or whatever. We can only add > options to PHP that offer choices to developers. If they do not use > them ... what can we do? > As a regular user of PHP, I like the idea of E_DEVELOPMENT and E_PRODUCTION. They're clear and will do what I would expect them to. Why not change the default php.inis to those values instead? I'm a against E_NONE, though. Now, I understand what a bit mask is, but imagine for a second that I didn't. Imagine that I want no messages except for E_ERROR. As a theoretically less experienced developer, I might assume that I should explicitly turn off all errors except for E_ERROR. What does that get me? error_reporting(E_NONE & E_ERROR). Oops. That doesn't work as I expect it to! Using a '0' makes it painfully obvious that it's not meant to combine with the other predefined constants. 0 is special. 0 doesn't play nicely with others. This is obviously an edge case, and a less experienced developer would hopefully learn very quickly the right way to do it, but I don't like the idea of giving people ammo to shoot at PHP and its wacky E_* constants. -- Tyler Lawson