Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:83071 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 36581 invoked from network); 18 Feb 2015 14:44:17 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 18 Feb 2015 14:44:17 -0000 Authentication-Results: pb1.pair.com smtp.mail=nikita.ppv@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=nikita.ppv@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.46 as permitted sender) X-PHP-List-Original-Sender: nikita.ppv@gmail.com X-Host-Fingerprint: 74.125.82.46 mail-wg0-f46.google.com Received: from [74.125.82.46] ([74.125.82.46:38768] helo=mail-wg0-f46.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 84/E4-18888-045A4E45 for ; Wed, 18 Feb 2015 09:44:16 -0500 Received: by mail-wg0-f46.google.com with SMTP id a1so1576501wgh.5 for ; Wed, 18 Feb 2015 06:44:13 -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=3/CmDl5HAT7i1v0+XmDSkuhEy5WXeye8onJ1lC2zL5w=; b=RTrKcif877TQ9cGyaZHC3flf8tfgeeW7rUNiK4n7QmLLJwEjeK0tg4hHQfJaRjKC7z P7DLzspeyfvzfe/BhjmfMP8vZ3P2wXOL9nCWsDCweKxgsKz4pi32DebHIP1EtpxLx+92 jAR5T5s4bZC3QAfy1s6Wq9LFwdH8KM4AqHXFiKxWJ8q3M7+9qMjqfOael/nqfk6g8YMb xmxwHMHd/G272hrpwR1IhxoeiD5Zq4Pt9aW5sflurp4uTV5+hbbSP9pNVXROlSRXKg0D fezFkatv9hqRq9cGpedkxTMQ/O9TwVoxVdRzo1DbRld6f5Gvj2jntVsj48SUX0skv6dg pexA== MIME-Version: 1.0 X-Received: by 10.180.198.240 with SMTP id jf16mr725305wic.27.1424270652132; Wed, 18 Feb 2015 06:44:12 -0800 (PST) Received: by 10.27.10.168 with HTTP; Wed, 18 Feb 2015 06:44:11 -0800 (PST) In-Reply-To: References: <54E1C24B.6010806@googlemail.com> Date: Wed, 18 Feb 2015 15:44:11 +0100 Message-ID: To: Dmitry Stogov Cc: Joe Watkins , Crypto Compress , PHP Developers Mailing List Content-Type: multipart/alternative; boundary=047d7b66f6db48d31c050f5dda6d Subject: Re: [PHP-DEV] RFC: Expectations From: nikita.ppv@gmail.com (Nikita Popov) --047d7b66f6db48d31c050f5dda6d Content-Type: text/plain; charset=UTF-8 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. 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". 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. Nikita --047d7b66f6db48d31c050f5dda6d--