Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:120690 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 33660 invoked from network); 27 Jun 2023 08:17:51 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 27 Jun 2023 08:17:51 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 118B01804B3 for ; Tue, 27 Jun 2023 01:17:49 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-ej1-f41.google.com (mail-ej1-f41.google.com [209.85.218.41]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature ECDSA (P-256) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Tue, 27 Jun 2023 01:17:48 -0700 (PDT) Received: by mail-ej1-f41.google.com with SMTP id a640c23a62f3a-98377c5d53eso515428966b.0 for ; Tue, 27 Jun 2023 01:17:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1687853867; x=1690445867; h=references:to:cc:in-reply-to:date:subject:mime-version:message-id :from:from:to:cc:subject:date:message-id:reply-to; bh=SwducmPrXTCzdkyjLl4EQJTl8SlC87wEYdYG5CyQifk=; b=EUDjrwsy7JrTu3WGi2/2I1G9GB0tD5nUmNS8ADLiMCLqwkFBebeeLKOyWkXx1LHaDG +Ui3jqZocV54i3TlI5PCr5D4+uViHDmZB/hAb9ZlWEC3NEKNBk4I794lEyuGY5uZIUx0 iucDaL1jvYLgAIT4ieIbOuJBtvawpxZtSRukbU330sIv/Ie2b+TV6MX+KWHMHcrySJsq RbzP+NITOoKlJKCUQsTsNrOPCeCKJ5O9t4p4Gy1I+VORZKRpHpLkObG7PJ5xG9Zjq8kg Q2FzNqD7o3GR+DG8g0zaDxOuDe9ELXm6sjPsIIRn6/Zik6Tg42AJwjJV18bgkV04s6Se avEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687853867; x=1690445867; h=references:to:cc:in-reply-to:date:subject:mime-version:message-id :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=SwducmPrXTCzdkyjLl4EQJTl8SlC87wEYdYG5CyQifk=; b=M7vCOE2gtVptpA0/pG/VlPsKFydijQyQGnvizG46ph1sHb6kSBJnyIUKWl7jYM7EdM Mv2Wel7iS0rC0D4jn7UDXbK016O412JWzToV+G7r9KUOPf7Ye3i/ja8/vtkK/EwrrF/x NiySrwnYAscZAxHTpfO3UljYKQwpH8KyGh0KFkPTjFrQivyycBSISUttKZ2V+dSgWZSM CEvm9avEYhTOSATRm0d2t4KNb237H+4sUnBihErTxJLPILimpXTs9vECfuuGLZjyj9j1 m8bc3vS8Jkt4WxuO4yOeWJP291PGqe3a1IZOLLW57kMaVr9ziP1PR+ZSBcS6KO+5Laeh M0ng== X-Gm-Message-State: AC+VfDwTP9oB3PYWwlpr2+CJLpdRetBbLDj2ZAZUIriXE9D+uQbhb0Cz 1/4/LnO9EvJoZtV21mzDbi4= X-Google-Smtp-Source: ACHHUZ660aF8BTSmLqQrHuAu+v3WMKN1U8tZckTda8IuG/M+xlAnpICKDs6BQ1wmbzZVQumqjS3QUw== X-Received: by 2002:a17:906:ef03:b0:974:183a:54b6 with SMTP id f3-20020a170906ef0300b00974183a54b6mr26258511ejs.33.1687853866924; Tue, 27 Jun 2023 01:17:46 -0700 (PDT) Received: from smtpclient.apple ([89.249.45.14]) by smtp.gmail.com with ESMTPSA id us3-20020a170906bfc300b00991bba473e2sm2193746ejb.85.2023.06.27.01.17.46 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 27 Jun 2023 01:17:46 -0700 (PDT) Message-ID: <7C9992E3-015E-48E6-A816-0AD012CA5CAE@gmail.com> Content-Type: multipart/alternative; boundary="Apple-Mail=_96CD1AE7-8D1D-4A44-B3D3-6BF0DA7AD932" Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.600.7\)) Date: Tue, 27 Jun 2023 10:17:35 +0200 In-Reply-To: Cc: PHP internals To: "G. P. B." References: <72F136AA-768F-4577-80EF-22212DB50EF3@gmail.com> X-Mailer: Apple Mail (2.3731.600.7) Subject: Re: [PHP-DEV] [RFC] Deprecate remains of string evaluated code assertions From: claude.pache@gmail.com (Claude Pache) --Apple-Mail=_96CD1AE7-8D1D-4A44-B3D3-6BF0DA7AD932 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > Le 26 juin 2023 =C3=A0 17:05, G. P. B. a = =C3=A9crit : >=20 > On Wed, 31 May 2023 at 23:20, Claude Pache > wrote: >> Although your RFC says that the `zend.assertions` ini setting has = superseded `assert.active` for a while, the =E2=80=9Cofficial=E2=80=9D = php.ini file still advises to modify the value of `assert.active` rather = than the one of `zend.assertion` in order to switch behaviour at = runtime: >>=20 >> = https://github.com/php/php-src/blob/91fd5641cde138b8894a48c921929b6e4abd5c= 97/php.ini-development#L1604 >>=20 >> I bet that many people (myself included) follows the advice given in = `php.ini`. >=20 > This talks about run-time modification, which is something that I = don't think should be done in practice, nor is often done. Although the specific comment in the php.ini file talks about runtime = switching, it is in fact irrelevant whether it is set at runtime or not. = More concretely; I use currently the settings: * `zend.assertion=3D1` as set in the global php.ini; * `assert.active =3D on` or `off` in my per-directory .user.ini or = .htaccess file, depending on whether I want to enable assertions by = default; * optionally `ini_set('assert.active', '1')` at runtime when I want to = enable debug mode temporarily. I have established the above settings several years ago (at the time of = PHP 7), after having carefully read the documentation (and having been = slightly confused by the redundancy between `assert.active` and = `zend.assertion`). I might have end up to switch between `zend.assertion = =3D 0/1` instead of switching between `assert.active =3D on/off` = instead; I can=E2=80=99t say exactly why I chose the former option = instead of the latter, but I guess that both the comment in the = `php.ini` file, and the existence of `assert_options(ASSERT_ACTIVE, = ...)` as an alternative to `ini_set('assert.active', ...)`, have = influenced my choice. Note also that the above settings minus `zend.assertion` was the way to = do it in PHP 5 (again it is irrelevant whether it is at runtime or not), = and many people that used assertions in PHP 5 may have continued to use = that way without modification, as there is currently no strong reason to = change (only `zend.assertions=3D-1` is relevant if you are especially = concerned about micro-optimisation). Now, of course, people will adapt to the new settings. But given the = confusing state of the options (both `zend.assertion` and = `assert.active` must be enabled, and I am not even speaking about = `assert.exception`), you ought to be super-clear (in the deprecation = notice, in the php.ini file, in the docs), what is the the expected = state: paradoxically leave `assert.active` and `assert.exceptions` = enabled (the default value) even when you want to disable assertions, = and playing exclusively with `zend.assertion`. =E2=80=94Claude --Apple-Mail=_96CD1AE7-8D1D-4A44-B3D3-6BF0DA7AD932--