Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:101868 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 80805 invoked from network); 14 Feb 2018 13:13:29 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Feb 2018 13:13:29 -0000 Authentication-Results: pb1.pair.com smtp.mail=tendoaki@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=tendoaki@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.161.181 as permitted sender) X-PHP-List-Original-Sender: tendoaki@gmail.com X-Host-Fingerprint: 209.85.161.181 mail-yw0-f181.google.com Received: from [209.85.161.181] ([209.85.161.181:43949] helo=mail-yw0-f181.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id D4/52-26725-8F5348A5 for ; Wed, 14 Feb 2018 08:13:28 -0500 Received: by mail-yw0-f181.google.com with SMTP id p2so1030044ywg.10 for ; Wed, 14 Feb 2018 05:13:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=+PWlATcfGQeT7Pt/XwC/OHr/S0jymjqvXFs5zLeOm8Q=; b=qHMhdkL9W7U6vth/pnnn27Cbt8Vsa2PMA+KrNT+2B00227sbVDJAQiwopFyHrfrR0u wRMUxVL03BUpkMRHk6Skti01GjVosn1c+YnVfMPPp/O7M7tpDNpr/RUYeN8L9Ukl+AKC HYjOKz82ZO8+lBjVScP26xMcc+dBeyzJXhSSShcy+/PJgZ9NQOpTDxnuh9ZYL94clOSB bJCCv7Ee42xEx1zc6Vu/mYQJFqoSSD3wZ4Eu9NbZh/Hd10LUGXrGkL4LbiySzL/JZ9+T k84YIkpxLxY670ztXnPpq45UW/htVXADxhUokehUUsLbPgraAy7nRDUvA5SmEPvUbHsQ avJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=+PWlATcfGQeT7Pt/XwC/OHr/S0jymjqvXFs5zLeOm8Q=; b=PaXBBubIayna6gTyls2L3l4HoiyZkh5XqN7XAxYEDn6ghnrTkDto5+ODWQeJyTahVj J6IXxsss1O2c+/IEBhhhlc4SMQRD4P1v0FPc0OQdu7QCr0xHPcNF++T+ps9Ap6+cOHX1 5aIW/er6JxMNeKjM9ulrH534zqHsAiFrfNbKZu9TLGYKFRsWXtY8hvg0bSNWc0q52gvS HCkU60h1GGlRvJC0mgNhKEIcWOKYt0WBw6I1rLaAiwiy4PwbV90OTvu1iDUG+zOl1XCb fG0KzDJShB+2Nc3/D2x4cNOCRBWFjrEz4eq5LjytXszIG5vpuQvxMePtB7OAz6dBX2Hz p51w== X-Gm-Message-State: APf1xPAnIzNN+Qiwvjxq1ymyTvQTzt9+D5sBAnjCJ0m+Ig+AE0ddmoKm 8DgqIeG1VFRxLuBujo7IEWBkRYeL5jkvd/zDwIY= X-Google-Smtp-Source: AH8x227eese1L1ohID1ADXaDhW5lRkRqW/sIp1hAgjcC5R/GM3mCA98o+Sao+0hzC2lFWwhOX3nNmg6qByDw7lz49ck= X-Received: by 10.129.159.83 with SMTP id w80mr3086068ywg.81.1518614005539; Wed, 14 Feb 2018 05:13:25 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: Date: Wed, 14 Feb 2018 13:13:15 +0000 Message-ID: To: Pedro Lacerda Cc: internals@lists.php.net Content-Type: multipart/alternative; boundary="94eb2c0b7d9059e6ff05652be0cf" Subject: Re: [PHP-DEV] About assert() From: tendoaki@gmail.com (Michael Morris) --94eb2c0b7d9059e6ff05652be0cf Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, Feb 14, 2018 at 1:16 AM Pedro Lacerda wrote: > Hi developers, > > Trying to resolve the bug #75950 (that after long hours I found that I > couldn't reproduce), I observed that if `zend.assertions >=3D 0` the > generated code inside `assert()` was indeed executed even if `assert.acti= ve > =3D off`. Naturally the function arguments were evaluated before entering > into the `assert()` function. > > https://bugs.php.net/bug.php?id=3D75950 > > The point is that will be possible to fully disable assertions setting > `assert.active =3D false` after initialization if we turn `assert` into a > statement. This can mantain fully backward compatibility. Calling > `assert_options(ASSERT_ACTIVE, true)` or `false` after initialization wou= ld > fully enable or disable the functionality. It seems the most sensible thi= ng > to do. > > By the way `assert` in Java and Python is an statement, and in C it isn't= a > function. > > So my question is what is the purpose of mantaining `assert()` a function= , > there are any drawbacks of fully disabling it when `zend.assertions >=3D = 0`? > > > PS: Strange that nobody cared in recent emails about the proposal to a > small increase of the testing coverage by doubling the testing time > duration, was somewhat interesting. > Assert.active is the legacy PHP 5 control. Don=E2=80=99t use it. zend.assertions -1 has the behavior you want. 0 emulates PHP 5 and earlier=E2=80=99s broken implementation of assert. If you don=E2=80=99t hav= e legacy software to babysit, don=E2=80=99t use it. > > --94eb2c0b7d9059e6ff05652be0cf--