Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:83477 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 23221 invoked from network); 22 Feb 2015 18:25:22 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 22 Feb 2015 18:25:22 -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.44 as permitted sender) X-PHP-List-Original-Sender: nikita.ppv@gmail.com X-Host-Fingerprint: 74.125.82.44 mail-wg0-f44.google.com Received: from [74.125.82.44] ([74.125.82.44:64445] helo=mail-wg0-f44.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id E8/60-18531-01F1AE45 for ; Sun, 22 Feb 2015 13:25:21 -0500 Received: by mail-wg0-f44.google.com with SMTP id k14so21905953wgh.3 for ; Sun, 22 Feb 2015 10:25:17 -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=q97AdJ64pdU8YbZpkAFe+btl0/aTQC63Bk8eFFf604o=; b=BDOZ+Ka8wnCsjcg415UZ86R342ji/ML1cTHHOkpwwSpOE49GUjZ9/8q2SPHl1tnXeS jUQJPf8+wbT3MoUUE85bWsZALe9gxF+osyuehQJAgxdCsHr35Ir91yNNKfepDPlGFQ6T Anseu5tXqoGxX/ssKV4RC/DL1tJf5zJ+6t/0m9q+3bffn3fwu8g9iqcqNAMTLVpRAb6i G2fi+btSxIdzCPDG5m4QzxooUXDRlKNnB5URi0Sms51kZjM8Sv0/jwLuV7vnF4cDCnpu trrVi/GmzilVRgl3obK/ZnOhiG4zS4bKNt4kPzyph3g4IdVxLz92d8zkVY32k9dPPRNx Hy1g== MIME-Version: 1.0 X-Received: by 10.180.198.240 with SMTP id jf16mr13862018wic.27.1424629516915; Sun, 22 Feb 2015 10:25:16 -0800 (PST) Received: by 10.27.10.168 with HTTP; Sun, 22 Feb 2015 10:25:16 -0800 (PST) In-Reply-To: References: Date: Sun, 22 Feb 2015 19:25:16 +0100 Message-ID: To: Dmitry Stogov Cc: PHP internals Content-Type: multipart/alternative; boundary=047d7b66f6db4adbe9050fb168fc Subject: Re: [PHP-DEV] Re: [RFC] Exceptions in the engine From: nikita.ppv@gmail.com (Nikita Popov) --047d7b66f6db4adbe9050fb168fc Content-Type: text/plain; charset=UTF-8 On Thu, Feb 19, 2015 at 4:13 PM, Dmitry Stogov wrote: > Hi Nikita, > > I refactored your implementation: https://github.com/php/php-src/pull/1095 > > I introduced a class hierarchy to minimize effect on existing code. > cacth (Exception $e) won't catch new types of exceptions. > > BaseException (abstarct) > +- EngineException > +- ParaseException > +- Exception > +-ErrorException > +- all other exceptions > > In case of uncaught Parse and EngineEexception PHP writes the compatible > error message. > I made it mainly to keep thousand PHPT tests unchanged. > If you like we may introduce an ini option that will lead to emitting of > "Uncaught Exception ... " with backtrace instead. > > The internal API was changed a bit. e.g. EngineException are thrown from > zend_error(), if the error_code has E_EXCEPTION bit set. > So to change some error into exception now we should change > zend_error(E_ERROR,...) into zend_error(E_EXCEPTION|E_ERROR. ...) > > All tests are passed. > I'm not sure about sapi/cli/tests/bug43177.phpt, because it started to > fail also in master. > > We may need to replace E_RECOVERABLE_ERROR with E_ERROR and fix > corresponding tests. > Despite of this, I think the patch is good enough to be merged into master. > > We may decide to convert more fatal errors later, but it shouldn't prevent > from putting RFC into vote. > > Thoughts? > I've updated some minor points in the RFC to be consistent with the new patch. The BaseException based hierarchy will be a separate vote [1]. If there are no further concerns I'd start voting on this RFC tomorrow. One point wrt the patch: Do you think it would be hard to use a clean shutdown on uncaught exceptions? This would make sure we don't forget to free anything when throwing exceptions. Nikita [1]: https://wiki.php.net/rfc/engine_exceptions_for_php7#hierarchy --047d7b66f6db4adbe9050fb168fc--