Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:83157 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 49998 invoked from network); 19 Feb 2015 08:28:40 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Feb 2015 08:28:40 -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.179 as permitted sender) X-PHP-List-Original-Sender: dmitry@zend.com X-Host-Fingerprint: 209.85.220.179 mail-vc0-f179.google.com Received: from [209.85.220.179] ([209.85.220.179:55550] helo=mail-vc0-f179.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 52/E3-22021-7BE95E45 for ; Thu, 19 Feb 2015 03:28:39 -0500 Received: by mail-vc0-f179.google.com with SMTP id hy4so650272vcb.10 for ; Thu, 19 Feb 2015 00:28:36 -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=HlM4QV0kmzQkjV3q+sEY6hnRhBIclxlTAgwAO0UKJC8=; b=ZESQEnIYwTeDBjYx5XHeMj6Zh+nt3cJcG7i6C5xrgGn+//DsK6q5LqKPAPHxPKReWQ EP+bEKi2D3jmt9KqFHpaCZi3IZB5KUZh4adE06wIZQ57Hc8N+cJdyTcX35Un6hVzdqTX Dny5RIqdfVeHIxKM5B2YCXJNhK2JOZod6+LedGYa77DW8QK91Mq1qG+pStZ+XxxmzL+t jagq65HXJfvrk1p/KNirBkIXmMRIz8KEOHKoGagkPTHZIHcDicjOCfgp9PdAs/Up9sGi F2McBBzt/8VjjTiqb5skjPMuHZPwYHzFWPiF9+gDW6G/dDUFFpENq6HI8EC/xI8KtBOm FdqQ== X-Gm-Message-State: ALoCoQkgTugPjOS1su3DROxP2jkOChvJtDTIixvYlWhbzmIY7E4maHvq4na3USTa1K6MHMw08+YUETz43XZ0tOJXTYiAI9x9URH7lRbZJaCJ54GIcyAtU8CO4s5oehP/nx9VaKgjpCJeQp5JfQ2emKrlDHIMC8UpCg== MIME-Version: 1.0 X-Received: by 10.220.185.193 with SMTP id cp1mr1091834vcb.80.1424334516086; Thu, 19 Feb 2015 00:28:36 -0800 (PST) Received: by 10.52.74.73 with HTTP; Thu, 19 Feb 2015 00:28:35 -0800 (PST) In-Reply-To: References: <54E1C24B.6010806@googlemail.com> Date: Thu, 19 Feb 2015 12:28:35 +0400 Message-ID: To: Joe Watkins Cc: Nikita Popov , Crypto Compress , PHP Developers Mailing List Content-Type: multipart/alternative; boundary=089e01538610df85fb050f6cb80a Subject: Re: [PHP-DEV] RFC: Expectations From: dmitry@zend.com (Dmitry Stogov) --089e01538610df85fb050f6cb80a Content-Type: text/plain; charset=UTF-8 Hi Joe, I think, we may just add additional vote question. - If we like to custom exceptons as second argument? but I don't care about it, so do as you like. According to AssertException: add a note into Open Issues section. e.g. we may introduce new abstract class BaseException then make Excepton to be a child of BaseException then introduce and use for assert AssertException (direct child of BaseException) All this changes are going to be implemented as part of Engine Exception RFC. And open the vote. Thanks. Dmitry. On Thu, Feb 19, 2015 at 10:58 AM, Joe Watkins wrote: > Morning, > > I hear the concern regarding custom exceptions. Things will be used badly > whatever. It's easy to imagine that in a simple application you just don't > need to specify custom exceptions. But in a large codebase, being able to > structure exceptions is invaluable, it gives documentation reference points > and makes stack traces easier to read at a glance, because they are more > meaningful. > > So I think we should keep the ability to throw custom exceptions. > > I agree about making the exception part of a new tree, so that they are > not caught, so I'll just wait for that from dmitry and open the vote. > > Cheers > Joe > > On Wed, Feb 18, 2015 at 5:01 PM, Dmitry Stogov wrote: > >> >> >> On Wed, Feb 18, 2015 at 5:44 PM, Nikita Popov >> wrote: >> >>> On Tue, Feb 17, 2015 at 10:50 PM, Dmitry Stogov wrote: >>> >>>> Hi Joe >>>> >>>> The patch is ready https://github.com/php/php-src/pull/1088/files >>>> >>>> 1) I implemented AST pretty-printer to reconstruct the source. It may >>>> be reused in Reflection and other places through >>>> >>>> ZEND_API zend_string *zend_ast_export(const char *prefix, zend_ast >>>> *ast, const char *suffix); >>>> >>>> 2) zend.assertions=-1 - makes zero-cost asserts >>>> >>>> 3) assert() in a namespace leads to call a function defined in this >>>> namespace (if it's defined), but zend.assertions is still may disable this >>>> call or even prevent code generation for it. it's possible to use \assert() >>>> to call the system function. >>>> >>>> Please, make update RFC, add notes about (2) and (3). >>>> Then, it should be ready for voting. >>>> >>>> Nikita, please take a quick look over the patch. I hope, you don't have >>>> objections. >>>> >>> >>> I've added a few comments on the PR. >>> >> >> Thank you very much. You found about 25 bugs :) >> All of them except for "elseif" should be fixed now. >> I also think printing "else if" instead of "elseif" is not a big problem. >> Pretty-printer may also add or remove brackets in some situations. >> >> >>> >>> Two general notes on the RFC: >>> >>> 1. I don't like the ability to specify a different exception as the >>> second param. Assertions are supposed to be used as sanity checks during >>> development, not to throw meaningful and specialized exception types. >>> Having this possibility will probably only encourage bad usage of assert(). >>> It's not a big problem to me, but I'd rather not have this "feature". >>> >> >> Joe, this is part of your old patch. I really don't care about it. >> >> >>> 2. Similar to the EngineExceptions RFC I'm wondering if >>> AssertionException should extend Exception or be in a separate hierarchy. >>> The same argument as with engine exceptions applies: It's pretty unlikely >>> that you want to catch an AssertionException anywhere apart from top-level >>> error handling code and that people using catch(Exception) blocks would >>> accidentally catch assertions. I'm not sure I agree with this, but I wanted >>> to mentioned the concern. >>> >> >> This may be changed together with EngineException patch. >> I started working on it, and I hope I'll show you results tomorrow. >> >> Thanks. Dmitry. >> >> >>> >>> Nikita >>> >>> >> > --089e01538610df85fb050f6cb80a--