Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:69871 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 90920 invoked from network); 25 Oct 2013 19:41:07 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 25 Oct 2013 19:41:07 -0000 X-Host-Fingerprint: 80.4.21.210 cpc22-asfd3-2-0-cust209.1-2.cable.virginm.net Received: from [80.4.21.210] ([80.4.21.210:8102] helo=localhost.localdomain) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id D5/49-40084-359CA625 for ; Fri, 25 Oct 2013 15:41:07 -0400 To: internals@lists.php.net,Stas Malyshev Message-ID: <526AC950.7020605@php.net> Date: Fri, 25 Oct 2013 20:41:04 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130625 Thunderbird/17.0.7 MIME-Version: 1.0 References: <52699FB5.20300@garfieldtech.com> <526A6BCC.3060502@php.net> <526AC472.8060607@sugarcrm.com> In-Reply-To: <526AC472.8060607@sugarcrm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Posted-By: 80.4.21.210 Subject: Re: [PHP-DEV] [RFC] Exceptions in the engine From: krakjoe@php.net (Joe Watkins) On 10/25/2013 08:20 PM, Stas Malyshev wrote: > Hi! > >> How could anything be reliant on the behaviour of a fatal error in any >> meaningful way ?? > > If condition X did not occur, fatal error would happen, so in the > following code I can safely assume condition X is true without checking it. > > That logic of course would completely break with non-fatal fatal errors, > both in C and in PHP. > > Oh yes, and people do try {...} catch(Exception e) { /* ignore > exceptions */} all the time (without, of course, counting fatal errors > as being ignored). > Catch all and error handling hacks to ignore fatals are covered in the RFC, I think satisfactorily, mostly ... I haven't really thought about it too much, it just seemed a bit silly to rely on what is essentially shutdown ... I'm liking the idea of BaseException, for this, and in general, would allow us to avoid the problem of catch all blocks, or at least the ones that are in existence now ... If we really wanted to, we could fix all the code that throws the base Exception, making them throw specialized types, as they should, and include a compiler check that finds catch(Exception) blocks and complains, it shouldn't really be valid, we could encourage people to do things the right way in the hope that someday we won't have to worry about catch all blocks when looking to make improvements ... Cheers Joe