Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:83155 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 42661 invoked from network); 19 Feb 2015 07:58:45 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Feb 2015 07:58:45 -0000 Authentication-Results: pb1.pair.com smtp.mail=pthreads@pthreads.org; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=pthreads@pthreads.org; sender-id=unknown Received-SPF: error (pb1.pair.com: domain pthreads.org from 209.85.192.174 cause and error) X-PHP-List-Original-Sender: pthreads@pthreads.org X-Host-Fingerprint: 209.85.192.174 mail-pd0-f174.google.com Received: from [209.85.192.174] ([209.85.192.174:41758] helo=mail-pd0-f174.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C6/03-22021-3B795E45 for ; Thu, 19 Feb 2015 02:58:43 -0500 Received: by pdno5 with SMTP id o5so7159660pdn.8 for ; Wed, 18 Feb 2015 23:58:40 -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=N1N2Em5F2IezWgau9PcmOzsuAnOclJbXAGQLAuyyWuI=; b=lAODGgojRT7MZNubo/qAZpvj5d5lI5bTmYelrYaywPFZYAG9JV0JijFFl5MqTkDVRz g2xYEE3/tLBAz0d/zc+uJ7DMv7iIzWoAu85riTWdphxs5XNZwUFqn5gCHSAv7Ox/xk2L QFhspxR38DNWkShSHCHYatzou/Tpt9IqiNZIQrYpQd0tKwJzglNkyW9Y7frV1zyahX7j r4a16ocISwG/ZSw917U5LGJnLIzKRbVF657j5WUHbpbrw1eacgKesXpr1TjjoJBBJqqx FrN6/gWeTENFWVkkemIFkqRGju+6S1BSexzSQxxdD7v5nqcWsu5HNJPSwwFEoJ4ZLwO9 4U6g== X-Gm-Message-State: ALoCoQlYkCeTLvN+bJLNcxJWI7E2K/W2RQeQrPuwCR1n8ytsMQdR2cKpvnT9d8MSl/C2DYkq95IH MIME-Version: 1.0 X-Received: by 10.70.27.33 with SMTP id q1mr5754773pdg.84.1424332720295; Wed, 18 Feb 2015 23:58:40 -0800 (PST) Received: by 10.70.49.100 with HTTP; Wed, 18 Feb 2015 23:58:40 -0800 (PST) X-Originating-IP: [86.190.233.59] In-Reply-To: References: <54E1C24B.6010806@googlemail.com> Date: Thu, 19 Feb 2015 07:58:40 +0000 Message-ID: To: Dmitry Stogov Cc: Nikita Popov , Crypto Compress , PHP Developers Mailing List Content-Type: multipart/alternative; boundary=047d7bd77068d5e739050f6c4da5 Subject: Re: [PHP-DEV] RFC: Expectations From: pthreads@pthreads.org (Joe Watkins) --047d7bd77068d5e739050f6c4da5 Content-Type: text/plain; charset=UTF-8 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 >> >> > --047d7bd77068d5e739050f6c4da5--