Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:101869 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 83190 invoked from network); 14 Feb 2018 13:43:31 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Feb 2018 13:43:31 -0000 Authentication-Results: pb1.pair.com smtp.mail=pslacerda@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=pslacerda@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.218.43 as permitted sender) X-PHP-List-Original-Sender: pslacerda@gmail.com X-Host-Fingerprint: 209.85.218.43 mail-oi0-f43.google.com Received: from [209.85.218.43] ([209.85.218.43:35311] helo=mail-oi0-f43.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 86/B2-26725-20D348A5 for ; Wed, 14 Feb 2018 08:43:31 -0500 Received: by mail-oi0-f43.google.com with SMTP id e15so16474375oiy.2 for ; Wed, 14 Feb 2018 05:43:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=zXhY58kgfJ+JkbNv/ogsW46A/0Pjl659/EXSUHCXP4o=; b=BPRS4Vor+F+Sja5jzMsSNCXUMtXrdt00r83OKhPu7F3y+qUfiKgyVqtO3HsA7yORWc JfhteNIiHyrCM7aV0T25y+Y/hdU5nyhVIseGdd0ITaMpXvo9s/u8KTWLhj8ThZdcbS6m x9m8uzxQKhK9VtD3npZklFBkGoprGFdoWWaZh/bvxcedvyYGvDLey+18bXs3wVXxCte8 lFVgR/Oavs7R1XrjPgtrJ4nSJV84KL2uzBoq77p9hs36o1tKbb5HDaOyozIr+WG1K2ki 2LTwZ0Hevd60iZN/gaN7OXby7Z9pWgURpz8uVEjoaISnp6P66QrpOApEujTEYZ+1HvsR q0fw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=zXhY58kgfJ+JkbNv/ogsW46A/0Pjl659/EXSUHCXP4o=; b=J+78DJGx3+BXDiIi9xCOB58Vr80oce3Qd0nvBo5tmAqJG8K4zZq/CNzX2BUU02NLEm sPFxL93M8VtUgm7H4mkXQuI8s5c3PYxxsYRBHN1c8Bj+ubqB3Amn3NKPnczZ5t+tI+Xw J+48jrro/aI/cd9kkFnfgBlml1a3A4ZOBSl2OGTQO/OKKpqFEVswQwLXQAK2Se01kiXC pxJzzJ67xrhU89FGR7A26IYqxCn6/nkbFcN5yk0iVx1WGOfAcGQHBiHmCeXSobuLh+Az LMQYGX29kSptcO2fR/lyoU80z5rW/TY1e7GEOJGdyMOy65hcBVq9/Jq6DkVF5Trm44Wt JfkQ== X-Gm-Message-State: APf1xPD/pnyhIR8N7zCcLKSav9he2Osb6hg41Q3V2D1VA7dD8g96w8sg XoVc3QdEf2yCYwx/jOqweBCB9XUg3wmk2niKN9e05A== X-Google-Smtp-Source: AH8x227a390AYiqhqoVI9oKa+JjK4NKEkfu/cQLEV0ZWu6L6Z4/FlOLk9Ixfd+EhxgAUIlnRoZlF8IGkp7O68bx49pY= X-Received: by 10.202.183.214 with SMTP id h205mr3411322oif.322.1518615807589; Wed, 14 Feb 2018 05:43:27 -0800 (PST) MIME-Version: 1.0 Received: by 10.157.7.195 with HTTP; Wed, 14 Feb 2018 05:43:07 -0800 (PST) In-Reply-To: References: Date: Wed, 14 Feb 2018 10:43:07 -0300 Message-ID: To: internals@lists.php.net Content-Type: multipart/alternative; boundary="001a113ce04cc304cd05652c4b57" Subject: Re: [PHP-DEV] About assert() From: pslacerda@gmail.com (Pedro Lacerda) --001a113ce04cc304cd05652c4b57 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable The same beharviour, but `assert` as statement also uses 1 character less. Em 14 de fev de 2018 10:13 AM, "Michael Morris" escreveu: 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. > > --001a113ce04cc304cd05652c4b57--