Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:83566 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 45279 invoked from network); 23 Feb 2015 12:09:19 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 Feb 2015 12:09:19 -0000 Authentication-Results: pb1.pair.com header.from=dmitry@zend.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=dmitry@zend.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 209.85.220.172 as permitted sender) X-PHP-List-Original-Sender: dmitry@zend.com X-Host-Fingerprint: 209.85.220.172 mail-vc0-f172.google.com Received: from [209.85.220.172] ([209.85.220.172:48124] helo=mail-vc0-f172.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 0B/0E-01128-E681BE45 for ; Mon, 23 Feb 2015 07:09:19 -0500 Received: by mail-vc0-f172.google.com with SMTP id kv7so7157218vcb.3 for ; Mon, 23 Feb 2015 04:09:16 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=KjH2rmHJU2oOr4EBYOt8hVndppOUKv9h4Xnso4mSnCM=; b=lxPFej8iQI/B54QOlHiaWKoIazbxJaxO64z4fzTkSHeQhVUnzLI+hksuNiU3H8snoQ jb+yDGdwg+kNu9yMHYjRnr1QKEPl7GBx8MVf70UAoLW8EF675eCZ3BS7iee0rWQ9QD4/ PfVKSPGoxu2a5viCScMmOqjFQzckFskym3kvqQwNjvSnzYoFgZRNO56X+MUiozsAuZ6e Cw5qxYv52cik6bYUQMWZ63+3Wo7q/PS6wOaiNV1/QFE63ESK34d8VIWgM9XzKrKX3wv9 IZRm7PvQ8dqHvHHCHB1voZ88AKqzhWarzw86igjFcNcXaDGpV5E6BbSLyg35PvHM6vLE gBTA== X-Gm-Message-State: ALoCoQmbT8Ok1jRDboYBdmbDkbfPJsa9N+Kt8VB9Z/T7Quip6P9dN8hrnzoc13awHQgcdCWgBJEPeH+tiTFf7bhIz6eMOfDwhFUddgWnVAw2d5f9X/t+zMwXqTMgwADZdvolyGchAV2JebKgn4rFPmxHtM3bA3+zSg== MIME-Version: 1.0 X-Received: by 10.52.25.11 with SMTP id y11mr10158633vdf.51.1424693356339; Mon, 23 Feb 2015 04:09:16 -0800 (PST) Received: by 10.52.113.231 with HTTP; Mon, 23 Feb 2015 04:09:16 -0800 (PST) Received: by 10.52.113.231 with HTTP; Mon, 23 Feb 2015 04:09:16 -0800 (PST) In-Reply-To: References: Date: Mon, 23 Feb 2015 16:09:16 +0400 Message-ID: To: Nikita Popov Cc: PHP Internals Content-Type: multipart/alternative; boundary=001a1133e5f26b3064050fc0455f Subject: Re: [PHP-DEV] Re: [RFC] Exceptions in the engine From: dmitry@zend.com (Dmitry Stogov) --001a1133e5f26b3064050fc0455f Content-Type: text/plain; charset=UTF-8 On Feb 22, 2015 9:25 PM, "Nikita Popov" wrote: > > 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. Yeah, please do. You may also note, that currently we kept "Recoverable Fatal Error" messages for some errors, that are not recoverable any more. The error mesages and tests should be changed later. They kept unchanged to make difference between important engine changes and obivious renaming. > > 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. Good, point. I think it shoul work near out of the box. Thanks. Dmitry. > > Nikita > > [1]: https://wiki.php.net/rfc/engine_exceptions_for_php7#hierarchy --001a1133e5f26b3064050fc0455f--