Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:82648 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 23685 invoked from network); 13 Feb 2015 23:25:16 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 13 Feb 2015 23:25:16 -0000 Authentication-Results: pb1.pair.com header.from=nikita.ppv@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=nikita.ppv@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.172 as permitted sender) X-PHP-List-Original-Sender: nikita.ppv@gmail.com X-Host-Fingerprint: 74.125.82.172 mail-we0-f172.google.com Received: from [74.125.82.172] ([74.125.82.172:37695] helo=mail-we0-f172.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 04/41-15073-CD78ED45 for ; Fri, 13 Feb 2015 18:25:16 -0500 Received: by mail-we0-f172.google.com with SMTP id k48so19422771wev.3 for ; Fri, 13 Feb 2015 15:25:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=WzIugfINKuT4pWfdlGNQK9y67Vgv7myCtSj7OHlaRDg=; b=XQc1VvVQEJQU+8I8uxX2iDfE/AmfYE3lGncubMoBuD26oYMvuvA72MsGdu7K5O8gCd NRtNF2wN05sR7bRDQrYHZfIUudbF9inEtctMvuVBsDCU6949UUlDX+xb6nsLUy8pxuQz yzrDPj0stssJ3Ai+TRqgy7cURKVLINl/hmgwk3L5fssZV6EqMCoMrESzHN7lUYppaNgq bHlACotyhOk/UTDvr1qBR3ZRqiCDkOrpJafQTjXEwdf9Kk3kh+re9bmKxSNiZ13FeDoq nJzb4W0Q5goWU7qgDzbyx5rY981lDlSR/XJpvGM8W51djHNv237DZyS01EBH1U/X8Yq7 rIxQ== MIME-Version: 1.0 X-Received: by 10.195.12.71 with SMTP id eo7mr9517186wjd.3.1423869913001; Fri, 13 Feb 2015 15:25:13 -0800 (PST) Received: by 10.27.10.168 with HTTP; Fri, 13 Feb 2015 15:25:12 -0800 (PST) In-Reply-To: References: Date: Sat, 14 Feb 2015 00:25:12 +0100 Message-ID: To: PHP internals Content-Type: multipart/alternative; boundary=047d7bb04ee45ef575050f008cb1 Subject: Re: [RFC] Exceptions in the engine From: nikita.ppv@gmail.com (Nikita Popov) --047d7bb04ee45ef575050f008cb1 Content-Type: text/plain; charset=UTF-8 On Mon, Oct 6, 2014 at 11:53 PM, Nikita Popov wrote: > Hi internals! > > During the PHP 5.6 development cycle I have proposed an RFC [1] that > suggested the use of exceptions instead of fatal errors in the engine. At > the time the proposal was declined, because the change was judged too > intrusive for a minor version. > > As such I'm re-proposing this RFC for inclusion in PHP 7: > > https://wiki.php.net/rfc/engine_exceptions_for_php7 > > The RFC text is essentially the same as previously, with the primary > difference being that parse errors are now converted to exceptions as well. > This was previously not possible due to limitations in the compiler design. > > Thanks, > Nikita > > [1]: https://wiki.php.net/rfc/engine_exceptions > Feature freeze is not so far away now, so I'd like to bring this RFC up again and proceed to voting shortly. There are two primary open questions: * Subclassing: Should there be more specific subclasses of EngineException for particular errors? * Superclassing: Should EngineException inherit from Exception (and as such be subject to catch(Exception)) or should we introduce some kind of special super-class that is not caught by default (like Catchable/Throwable)? I don't think we can implement a high-quality subclassing scheme in a timeframe for PHP 7, as such I would suggest to postpone this (if we actually want to do it) to a later point in time. We can introduce subclasses without BC issues in a minor version. The question of whether EngineException should inherit from Exception is something we do have to consider now. Personally I prefer not introducing any special exception types that aren't caught by default. I think that would only make sense for errors that could occur literally everywhere (like memory limit or timeout), but these are not handled by this RFC for technical reasons. If someone has a strong opinion on this, I might make it a voting option. Commentary on these, and also any other relevant points is very welcome! Thanks, Nikita PS: The patch attached to the RFC is very outdated. I plan to only update it to current master once the RFC passes (if it does), as I already had to practically rewrite it a few times. --047d7bb04ee45ef575050f008cb1--