Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:62445 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 53280 invoked from network); 24 Aug 2012 07:23:55 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 Aug 2012 07:23:55 -0000 Authentication-Results: pb1.pair.com smtp.mail=nicolas.grekas@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=nicolas.grekas@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.210.170 as permitted sender) X-PHP-List-Original-Sender: nicolas.grekas@gmail.com X-Host-Fingerprint: 209.85.210.170 mail-iy0-f170.google.com Received: from [209.85.210.170] ([209.85.210.170:43780] helo=mail-iy0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id D0/B3-30159-A0C27305 for ; Fri, 24 Aug 2012 03:23:55 -0400 Received: by iamm10 with SMTP id m10so3300441iam.29 for ; Fri, 24 Aug 2012 00:23:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; bh=9g9MXxyB76d6F0DnQq6IgtZ8N9znGep1Tlk8idS+kGA=; b=BJ3+EjRxcJ89wLlxzxjQm2JzKLAB96DDngkGsAB1A7zkxR5w3qUVzqauQ/DEYM0LJk Si5JJeqwX4M9U3O8rwRf52KmCpZKnU6owpfQzaYKNTU5gmr65hmHngz++L5YdFKHmFu8 pswMxfWzT5cLQv6cWCpdMuLgoE+UqNjY11FOy/Dm+6tM/9pT/nWBYOp4E9+V2K9eS0JU /rwMu1XbrhgkocfQ3RdwuCwrt1NZX+o7DOxuQciC16U6CAFPzDC8NvtWA8kSVfONxARz J7VJwEAZRw5obT1Dqu9Ddsm//+UqmIDIIHKPdETk4aeVwkwt87z6+JBiZ6Em23HBHSCZ b8PQ== Received: by 10.42.204.68 with SMTP id fl4mr3589763icb.35.1345793032431; Fri, 24 Aug 2012 00:23:52 -0700 (PDT) MIME-Version: 1.0 Sender: nicolas.grekas@gmail.com Received: by 10.64.104.99 with HTTP; Fri, 24 Aug 2012 00:23:32 -0700 (PDT) In-Reply-To: <3E3A531D90FC43B8B7E9CDD37F1EEE40@pc> References: <3E3A531D90FC43B8B7E9CDD37F1EEE40@pc> Date: Fri, 24 Aug 2012 09:23:32 +0200 X-Google-Sender-Auth: UyOTe9_jzmC45CxEp2zUs3o-0OM Message-ID: To: Stan Vass Cc: Ferenc Kovacs , PHP Internals , Andrew Faulds , Etienne Kneuss , Stas Malyshev Content-Type: multipart/alternative; boundary=20cf303e9d92a3a86404c7fddb6a Subject: Re: [PHP-DEV] Error handling brainstorming From: nicolas.grekas+php@gmail.com (Nicolas Grekas) --20cf303e9d92a3a86404c7fddb6a Content-Type: text/plain; charset=ISO-8859-1 > ** > The overall mood seems to be that since PHP has an error handler, everyone > is free to handle errors any way they want. > 2) When everyone starts handling errors in their own way with error > handlers, you can't reliably use third party code. You are in your own > universe. > I think that's the main point that makes any change to the way PHP currently handles errors difficult: The current behavior is to continue the execution flow (except for fatal errors of course) whereas an exception always breaks it. Throwing an exception, either in a custom or in a new internal handler, introduces a major portability + backward compatibility issue. But do you think it could be possible to introduce a per script declaration of the way it has been coded regarding error handling ? We could imagine for example that any script that is coded assuming exceptions instead of errors could be force to declare with a : or maybe : 1) PHP Errors come with a severity code and a string message. You want to > handle specific errors in a specific way? You better start writing giant > regexes parsing the string messages. > This is a problem that could also be addressed with the current error handling mechanism: that would require that any error comes with some unique number for example. Is this possible? Independently of the exception vs classical error discussion, that would be amazing. Regards, Nicolas --20cf303e9d92a3a86404c7fddb6a--