Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:115184 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 12205 invoked from network); 28 Jun 2021 17:34:17 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 28 Jun 2021 17:34:17 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 288931804F3 for ; Mon, 28 Jun 2021 10:54:03 -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, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mail-il1-f170.google.com (mail-il1-f170.google.com [209.85.166.170]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Mon, 28 Jun 2021 10:54:02 -0700 (PDT) Received: by mail-il1-f170.google.com with SMTP id v5so18276523ilo.5 for ; Mon, 28 Jun 2021 10:54:02 -0700 (PDT) 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:content-transfer-encoding; bh=ovo+RfdzY4QY0RYM5FyucKwkZkG3O37GT0Aa0m8rke8=; b=WL0tHK9s9xn5KZyDPNFy7M1+ZLmXmKHzqIbXXVNWbOIgw3ZQpjBNporOiVhNW1kd4A 80EJr3FyhyirSNpru6e2mQI/6FQn3bmAjhS8oVSXURLCaDBJLvEyR3GBG6rSs83FiiSZ MASz4jizTfZoegBszBYMzCaZgm71p8hqBlEAkfEE1oiFsfBTuDfDPf+TK8vojZFGcoIS y/zIFohbRHrFFRfBDPAQTJ6i2XH7r3YCzPYULLJt7bVvTsdynfVu0LDKltgW54twRwkD QjAcrxRLPu8OKUlGAeiOU/Suv/X2t4w1y7cITvgWdTJ7frYJmBvDPJ5kXffAB5wfXT48 tUYQ== 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:content-transfer-encoding; bh=ovo+RfdzY4QY0RYM5FyucKwkZkG3O37GT0Aa0m8rke8=; b=pQsJzp3/VlO3gzvPqWlqRRJEFiZ8Z1AS8hyXWT/H6EPEKu/+XjdMZry+LOgRE7W/Yr QXBToB+OjuDjwlafYPhkzul3OKFIDlya7JBDuOvf21P4YqZOK/P+q32aOQQTAcsPZoEj e8B3SOiaKn3CLLdj/n8lLrOXO9vhC2/qaj7IqqUAp/UsdkbMWMMrxPpu3N83qhWU8YiR l8bRT2bgBoT36QYlfQYgvhLU2LHMZUJyYrPJnkKbZMKspAXwQ/gS4bIWxAPA/a4ybwjD KDRtLRsuOw4cDJ4wK/9dA2Q8MaBzvqESRSoR/GOGJkwxk1k6Cwypv2jz0iuXPEAOX9Zr hQbA== X-Gm-Message-State: AOAM5325ZAdB7BcE+Cj/jpDWntPWeP5UFXTn4+4WPfczr4cyINhNVDTj /Gi5wtdIs/JaehtElYsiQ1E5BhMluh7E7cg9cUYuGx6ZSRSbXg== X-Google-Smtp-Source: ABdhPJyou8sQtygfroBq32krNrvpT/+0Kzrl3fsejlXlfflwQOGLyxCIwtRlENV7zAkcJKx+sWdlBSejVGapnKQ299A= X-Received: by 2002:a92:680c:: with SMTP id d12mr12097167ilc.67.1624902840175; Mon, 28 Jun 2021 10:54:00 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Mon, 28 Jun 2021 20:53:33 +0300 Message-ID: To: Craig Francis Cc: PHP internals Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] is_literal() compile-time awkwardness From: weirdan@gmail.com (Bruce Weirdan) On Mon, Jun 28, 2021 at 7:21 PM Craig Francis wr= ote: > There=E2=80=99s an awkward hitch with removing integer support. Correct me if I'm wrong, but all those inconsistencies would happen even if all integers were considered literal, e.g. https://3v4l.org/C9YpE/vld#output clearly performed compile-time concatenation with a float. > Now these aren=E2=80=99t security issues, and it doesn=E2=80=99t work the= other way round: > `is_literal()` doesn't incorrectly report any user (non-literal) data as = a > literal. I'd say it's fine that way. > OPcache adds its own similar twist if it=E2=80=99s enabled, but with the = added fun > that unlike PHP=E2=80=99s own optimisation processes, OPcache is by its n= ature > inconsistent when it runs, changing what it optimises and when based on a > number of factors (e.g. available memory) and so isn=E2=80=99t guaranteed= to > optimise the code every time. Now that's a problem. If the same code produces different results for expression literalness depending on external factors like available memory it may pass in the test environment, but fail in production. --=20 Best regards, Bruce Weirdan mailto:weirdan@gmai= l.com