Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:70533 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 56918 invoked from network); 8 Dec 2013 14:18:24 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 8 Dec 2013 14:18:24 -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 209.85.219.47 as permitted sender) X-PHP-List-Original-Sender: nikita.ppv@gmail.com X-Host-Fingerprint: 209.85.219.47 mail-oa0-f47.google.com Received: from [209.85.219.47] ([209.85.219.47:40150] helo=mail-oa0-f47.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 6E/C7-01020-FAF74A25 for ; Sun, 08 Dec 2013 09:18:23 -0500 Received: by mail-oa0-f47.google.com with SMTP id k1so2768098oag.6 for ; Sun, 08 Dec 2013 06:18:20 -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 :cc:content-type; bh=UYWzwMH3OMf/E7+2Gbk6/Q+56V+ktY60HudBM90BOT0=; b=nN1cn1iMi9WBDPCR4x4UFs+onGY0bT60z7F73FyDvIGcqax10XbCiTgYYtQ7EpDVCX 1Omog2k8fmuMF93KPanC0M6gGXbhpX32aVHHdecBhxZQADRwmftaeDFK1WilgS4KWyh3 5M1QftAUmqq85MM5yzPBQgVYb3XHCtIfFUaPEJ6q2IT6COl5hVEksJdz212vjMb1IC7d zOZldum0xUI8gzL21M2Kwp91XyXjxYA6s0uq0QMRPzqRScZ4SpcFXpHWZpckqbwVN78/ ZoqcOFcXqhxJkc3tLtdXWAoaQ9cNCilK2B2eKB2QEbLRaAgTgL4HujUYB3/jdWXUQwHj YAxA== MIME-Version: 1.0 X-Received: by 10.60.60.71 with SMTP id f7mr16968oer.82.1386512300764; Sun, 08 Dec 2013 06:18:20 -0800 (PST) Received: by 10.182.54.112 with HTTP; Sun, 8 Dec 2013 06:18:20 -0800 (PST) In-Reply-To: References: Date: Sun, 8 Dec 2013 15:18:20 +0100 Message-ID: To: Zeev Suraski Cc: PHP internals Content-Type: multipart/alternative; boundary=089e0149ca1029f4be04ed068d9c Subject: Re: [PHP-DEV] [VOTE] Allowing use of exceptions in the engine From: nikita.ppv@gmail.com (Nikita Popov) --089e0149ca1029f4be04ed068d9c Content-Type: text/plain; charset=ISO-8859-1 On Sun, Dec 8, 2013 at 2:55 PM, Zeev Suraski wrote: > Nikita, > > Apologies for not having followed the discussion a few weeks ago but I > think this proposal can't be accepted as it is even if everyone likes it. > It breaks a very basic design concept in the way both the engine code as > well as extension code is written - execution will never resume beyond an > E_ERROR. > > Allowing execution to resume (through the use of exceptions) opens a huge > can of worms, and sets expectations we can't meet. In fact, the main > difference between E_ERROR and E_WARNING is the recoverability, so this is > not some small detail we can fix - we simply can't assume execution can > continue after an E_ERROR is triggered, because E_ERROR in its very > essence implies no-resumed-execution. That's also the reason error > handlers (that existed before exceptions did) don't handle E_ERROR. > > I don't think a vote makes a lot of sense here, since it's asking people > whether they're in favor of the concept of being able to recover from any > kind of error. That's the wrong question (to which, by the way, I'd vote > 'yes'). The real question is whether people are OK that the engine will > start randomly crashing through the use of standard PHP code, which is > pretty much out of the question. > > If there are E_ERROR's which you think are erroneously tagged as E_ERROR's > and should in fact be E_RECOVERABLE_ERROR, we should change them, rather > than assuming that E_ERRORs can be tagged as recoverable wholesale... > Hi Zeev! I think this is a misunderstanding... I'm not suggesting to simply let the engine continue after an E_ERROR - as you pointed out, that would likely just crash it a few lines further down. This RFC is mainly a policy RFC: The goal is to allow the use of exceptions in the engine and to allow changing existing fatal errors to exceptions. The change from fatal errors to exceptions needs to happen manually, by adjusting the surrounding code to support continued execution (usually that means freeing resources + returning). A lot of fatal errors are easy to change, others are very hard or impossible. Changing fatal errors to exceptions rather than recoverable errors is both more useful to the end user and technically easier (as recoverable errors need to continue execution in the same codepath, which is often a lot harder to implement and find appropriate semantics for), which is why I'm suggesting this particular course of action. So, basically what I'm suggest is what you say in the last paragraph, just going directly to exceptions rather than converting to E_RECOVERABLE_ERROR :) Hope this is a bit clearer. Nikita --089e0149ca1029f4be04ed068d9c--