Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:101867 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 65225 invoked from network); 14 Feb 2018 07:16:23 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Feb 2018 07:16:23 -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.52 as permitted sender) X-PHP-List-Original-Sender: pslacerda@gmail.com X-Host-Fingerprint: 209.85.218.52 mail-oi0-f52.google.com Received: from [209.85.218.52] ([209.85.218.52:45210] helo=mail-oi0-f52.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 3B/80-26725-442E38A5 for ; Wed, 14 Feb 2018 02:16:21 -0500 Received: by mail-oi0-f52.google.com with SMTP id 23so3739405oip.12 for ; Tue, 13 Feb 2018 23:16:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=uxyKfFiM6cnjuI7OlhIfOEpaJvYIYKPsrMxADaYIUPU=; b=DtPMFD27fQZgL2d16FpKRyC24//eKyC6Q5htu2watL4AZfLz9yNaVCvHrZGlsuHzUi ttEdA5ZiN7vdu442MQOGrMZCAJw1/rcHbRzxlYogj/ASJhPF0I+YU+ClwJF76h7uH9CT 1Xk+LNpmGg2/fUglM2+SrE+Kqbyi2rkmitoXGKyA+TaElQF9h6icJvJskWVGe99bxJVQ 3mNLIGqkoE77lAr1cIi5rAcVXu8yHENvaMl70fFRbg3cWAMP/jfJOj1IWZTH0V0eARBe XKiwfUS7Qu5Uu5cp2I/Hc3JVMD5dC4uNHQ4kXOZ46uo98jIr4Bw8Dii+1j6B5MBw0lva qmEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=uxyKfFiM6cnjuI7OlhIfOEpaJvYIYKPsrMxADaYIUPU=; b=Dnz5IvQXQEIsHFc262/0h/qn2cyjZMv+dAxT34wx7/2BdlJ1Ptir+wBTsOKo22imRa 45nU9YDiO8eaObtt8cmkI6yqDzuGBvVRFD8Kv1fFye+11fZs3LhxaNtaNN11KDqb0gNN x2HL9U2t63vwGlwAjTYyQtk7YFOtwZheQQA5xqqRb4VlBh3gD2qKL/LTjTMQSuLdt5Ja sGyzrc0o3BAh/oOcW0unvt3w/6lAqUYpt+uJvMD5BZigvrZqC1jma8RbREvVxni29qjC 24WJ/CQgoI51FvLjTgypQV4oO/U9x8XV2VgKsyfWQMRI6Liok8mVjYOVBUxUSG/pOUtW puyQ== X-Gm-Message-State: APf1xPCzgm+FFo+YVNCG4su31khLWuWWOghGxh5V5x2ccwUDEEsNwQ+s o2xU2LK1UIMakvlOZfGMuJMQAn8Xq3ZcmRe1WFy7WBQr X-Google-Smtp-Source: AH8x224j/IdeMOkNIfQ7rjoCafPU/8qgWEssbW9nW6cpihbYIJn/muwgqUAwi6jRuEKSAC0tUbOLbmnlVXFiYg2a5hs= X-Received: by 10.202.43.2 with SMTP id i2mr2379772oik.54.1518592577915; Tue, 13 Feb 2018 23:16:17 -0800 (PST) MIME-Version: 1.0 Received: by 10.157.7.195 with HTTP; Tue, 13 Feb 2018 23:15:57 -0800 (PST) Date: Wed, 14 Feb 2018 04:15:57 -0300 Message-ID: To: internals@lists.php.net Content-Type: multipart/alternative; boundary="f4f5e808e8802a540c056526e3c3" Subject: About assert() From: pslacerda@gmail.com (Pedro Lacerda) --f4f5e808e8802a540c056526e3c3 Content-Type: text/plain; charset="UTF-8" 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 >= 0` the generated code inside `assert()` was indeed executed even if `assert.active = off`. Naturally the function arguments were evaluated before entering into the `assert()` function. https://bugs.php.net/bug.php?id=75950 The point is that will be possible to fully disable assertions setting `assert.active = 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 would fully enable or disable the functionality. It seems the most sensible thing 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 >= 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. -- Atenciosamente, Pedro Lacerda --f4f5e808e8802a540c056526e3c3--