Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:83093 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 85793 invoked from network); 18 Feb 2015 17:01:33 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 18 Feb 2015 17:01:33 -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.160.172 as permitted sender) X-PHP-List-Original-Sender: dmitry@zend.com X-Host-Fingerprint: 209.85.160.172 mail-yk0-f172.google.com Received: from [209.85.160.172] ([209.85.160.172:57836] helo=mail-yk0-f172.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 62/85-56339-B65C4E45 for ; Wed, 18 Feb 2015 12:01:32 -0500 Received: by mail-yk0-f172.google.com with SMTP id 131so1359558ykp.3 for ; Wed, 18 Feb 2015 09:01:28 -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=avMMUwMR4jmqeXWjdbGUQojVxYbNqH+uhCEZwr4FqQw=; b=JZuEhmHuFouMJfgZ7j9AiZl47NPoCPICYfvLVKxr+N1v2PjimvKqds3rVU7tOBc1UD T+52QQ+vFkmF7q8QFY3agy+ONDx4Q3SSKwFDMIs0D2wLjqOcKrQU2d02Jgw2vi6HmX29 bj6CpIAbbibfvzQNRRwiC7GbDLNnzOKmwzhnquWgD8lqHwy/tBaslb27jXnE1ZvHY/Qw ZO+2vCLWClCtnBcYKTatX4RHM23npB1pKrQozWlzbDo46FKW4UTuxEeStwuMzKOJyAsX cZRZQbxDaUO70GxHEbMhrFGVgCbxM9DwcbE1hvtuOn4uH7nMvpW+Sm8nQurxcLYVlQst 9YEA== X-Gm-Message-State: ALoCoQkZHZ85CT+i9pbJdJKbyiNTyCkbS9z3EVvAnBNAqSHqc0eeQbRyduvLgP5a+x+oUxZoEK+gz9JuNRGLhvUlq31/SFW91egDXgKvDtKpZsxKt3nRDMeTwMr7KBh5tLdRYYiCBpyHC4mz3CYGxxkYRCIRc054bQ== MIME-Version: 1.0 X-Received: by 10.52.52.136 with SMTP id t8mr109256vdo.49.1424278887693; Wed, 18 Feb 2015 09:01:27 -0800 (PST) Received: by 10.52.74.73 with HTTP; Wed, 18 Feb 2015 09:01:27 -0800 (PST) In-Reply-To: References: <54E1C24B.6010806@googlemail.com> Date: Wed, 18 Feb 2015 21:01:27 +0400 Message-ID: To: Nikita Popov Cc: Joe Watkins , Crypto Compress , PHP Developers Mailing List Content-Type: multipart/alternative; boundary=089e0115f048299910050f5fc521 Subject: Re: [PHP-DEV] RFC: Expectations From: dmitry@zend.com (Dmitry Stogov) --089e0115f048299910050f5fc521 Content-Type: text/plain; charset=UTF-8 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 > > --089e0115f048299910050f5fc521--