Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:107128 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 63195 invoked from network); 16 Sep 2019 01:33:58 -0000 Received: from unknown (HELO localhost.localdomain) (76.75.200.58) by pb1.pair.com with SMTP; 16 Sep 2019 01:33:58 -0000 To: internals@lists.php.net References: Date: Mon, 16 Sep 2019 00:10:45 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit X-Posted-By: 5.69.57.161 Subject: Re: [RFC] Reclassifying engine warnings From: marandall@php.net (Mark Randall) Message-ID: On 28/08/2019 10:33, Nikita Popov wrote: > https://wiki.php.net/rfc/engine_warnings I am 100% behind the exception proposals, however I did want to discuss the warnings. I am personally of the belief that there should be a distinction made between notices / warnings issued by the engine, and those issued by extensions, including standard. I am one of a large number of developers that enforces a "No notice or warning" requirement on their codebases. To this end I use a global error handler that converts ANY notice or error to an \Error exception (within our specific code, so excluding anything in /vendor and the likes). This does however, effect function calls as well, and it's less ideal to have function calls throwing Error, something derived from Exception would make more sense. The issue is which is which. If this does pass, I was wondering if there would be any appetite for re-using the E_CORE_XXX error error codes specifically to refer to ALL engine warnings, not just those at startup. Alternatively, the passing of a bitflag to indicate they came from the engine while still preserving the original bit, although that may be more of a BC break due to requiring bitwise mask comparison in existing handlers. Either way, this this would allow easily differentiating engine warnings that will become more prominent in this RFC, with those contained in PHP_FUNCTION scope. -- Mark Randall