Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:83204 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 51868 invoked from network); 19 Feb 2015 15:23:59 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Feb 2015 15:23:59 -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.180 as permitted sender) X-PHP-List-Original-Sender: dmitry@zend.com X-Host-Fingerprint: 209.85.220.180 mail-vc0-f180.google.com Received: from [209.85.220.180] ([209.85.220.180:60318] helo=mail-vc0-f180.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 81/8C-18870-C0006E45 for ; Thu, 19 Feb 2015 10:23:57 -0500 Received: by mail-vc0-f180.google.com with SMTP id im6so1361253vcb.11 for ; Thu, 19 Feb 2015 07:23:53 -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=VqcfsGJ/Pl7V1bHaSb3yi8lnf5BL0zFddBYxpDRgWhI=; b=Zgt49vrPniu3EP+yP2E5jQG+P7nCIqOdXNiyTpIM4u2sEwoSclLS2JhvkOxIkg0FcB 98OBzrWUkjdre1JYU9gQ6spSPs43NXHNux8CoeSlVxv16zkyGFa/vgpq/qoi12Hyibtf +gv6hjyJUWA4KMov9hg7svAg8HfkZ+6Lj6JAIhTTCW3o3iZs56EWS4Em4yFDTej9LHdT YAX0l+MBuW1VmvRa3gl5zpvaufwGxKgx6l7jxuRH6Aon5pQyqdCQR9bk4eyfqFLWMaAG UvbOnIlJIiSigh1f0QZju2Clliq0+k3YKYcIDbms7Ce1Aszy4WB/AbyRCwwTD6jXdx+V /AlQ== X-Gm-Message-State: ALoCoQmo/KPCEVG6+/7oqv1VDK56LO4yJlCM2kDo4Sjf5GJgRUclGrjE+LP/KwueOaSTxZkADpH9XFZ6CHFw3TxsK8V9UcGIswY7q4FlnwXg1BVD0j1y3SlcHbxPEnK8mUZ+MiblwLfnNb/zwCAKlKA5O98nPy4daw== MIME-Version: 1.0 X-Received: by 10.52.103.75 with SMTP id fu11mr2312914vdb.5.1424359433612; Thu, 19 Feb 2015 07:23:53 -0800 (PST) Received: by 10.52.74.73 with HTTP; Thu, 19 Feb 2015 07:23:53 -0800 (PST) In-Reply-To: <54E5F77D.9090406@fischer.name> References: <54E5F77D.9090406@fischer.name> Date: Thu, 19 Feb 2015 19:23:53 +0400 Message-ID: To: Markus Fischer Cc: PHP Internals Content-Type: multipart/alternative; boundary=047d7b86d99012c927050f728604 Subject: Re: [PHP-DEV] [VOTE] Expectations From: dmitry@zend.com (Dmitry Stogov) --047d7b86d99012c927050f728604 Content-Type: text/plain; charset=UTF-8 On Thu, Feb 19, 2015 at 5:47 PM, Markus Fischer wrote: > Hi, > > On 19.02.15 10:09, Joe Watkins wrote: > > Morning internals, > > > > The expectations RFC is now in voting phase: > > https://wiki.php.net/rfc/expectations#vote > > - I somehow miss information what the exact differences are to the > current implementation, to better judge the impact. > The implementation introduces ZEND_ASSERT_CHECK instruction that will jump around calls to assert() depending on zend.assertions ini option. (call and constraint evaluation may be expensive). It's also possible to avoid compilation of asset() at all (setting zend.assertions=-1) This will allow using assert() for program testing, without performance degradation in production. > > - how does zend.assertions and assert.exceptions work with > "assert_options()" , i.e. isn't the exception behavior meant to be an > addition to assert_options() too ? > zend.assertions control assert() compilation and execution zend.assertions=-1 zero-cost, assert() won't be compiled at all (including inner code) zend.assertions=0 low-cost, assert() will be compiled but won't be executes (including inner code) zend.assertions=1 assert() wiil be compiled and executed as now > - the RFC says: "enabled (zend.assertions=1) on development machines, > and disabled (zend.assertions=0) in production"; a few paragraphs above > it says "-1 - don't generate any code (zero-cost, production mode)". > Shouldn't be -1 the default value for production then? > With zend.assertions=0 in production, you'll able to switch to zend.assertions=0 at any time. With zend.assertions=-1 of course not. > - the RFC says: "A call to assert(), without a fully qualified namespace > will call assert in the current namespace, if the function exists. An > unqualified call to assert is subject to the same optimization > configured by zend.assertions. ". Does this mean I can control whether a > function in a namespace is being optimized-away with when zend.assertion > equals -1 and otherwise do my own stuff in there and need to raise an > AssertException on my own to signal assertion fails? > Yes. you are able to eliminate your own assert() functions in namespaces. Thanks. Dmitry. > > thank you, > - Markus > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > --047d7b86d99012c927050f728604--