Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:115408 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 19765 invoked from network); 12 Jul 2021 14:22:49 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 12 Jul 2021 14:22:49 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 415981804AA for ; Mon, 12 Jul 2021 07:46: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,NICE_REPLY_A, 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-wr1-f41.google.com (mail-wr1-f41.google.com [209.85.221.41]) (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, 12 Jul 2021 07:46:02 -0700 (PDT) Received: by mail-wr1-f41.google.com with SMTP id a13so25963925wrf.10 for ; Mon, 12 Jul 2021 07:46:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding:content-language; bh=cz5c4FyU+vcpwJwE3XB/zVfYe9q8X2t6tus46qeBBpo=; b=rF/qhTFxOX5XfsZu6qF13IE+HBrXY1wg6FEJw5/ayFkH8dNxk+4bwSEiVePsDNnSbF NmwKxgGQdkED8i9lKJ4yo1Rv+wC8rDRXWGF8HtpbRfFyi6NJr4yyplq0xxFLIeY98oom 51Tr4AP+5K59luWgPcvcyPxW5pZA9rPVgNgQzBA5sokZb9V0HU+qU2LLgBDVX2tNlEHc uXk3qEtEmdbrFtnL/oaAy8kP4QytvWV0VfQvYxMasDV4WJEmcu024inlfyCwcj9Z/DLx LwJ5nv/yHu5sMiHBBSnc50oi1mSRhqm3Phby+6FZhh0BFVVby67nRzSh+Ccq36pjeEko qc1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=cz5c4FyU+vcpwJwE3XB/zVfYe9q8X2t6tus46qeBBpo=; b=ksi3q1a2jiOUWOEiGGk037cAuXW6X2OaI07CDs57GwdtZfOjAN9em/wnS7Fx0kjOO6 m/9hPZC2gnOU/PJXF8SmVAwScx1nSaxq38CJGlpiPE+f4z9LbOo+EXu2Yx3K1r8YYWKH 4zscjriGepOyOJXsbf/t49dwuAUxq3trYSKmWZZ7drzWrDYkpy+3JgmgjP9ZnpDRlxqO lRfJ9K05tt8mKNm8Hq0yDe9LKaNoRu88lgFCYgnfZc8Jupu7Fogwr9JkZN/RtMqoNJJX grfkknVvt7nYm79srfSeQPQML2ZY8dwVTSky3wuRF4SPpHgZ86rEdf6OROa8ClUnBEmi KjIg== X-Gm-Message-State: AOAM530CK1bjnAjuzYzcVJqy3y7QdYre0+11i2pDWIUnJSuKABxdzvKA c9OS+fPTBrdT61VrgDTl3FTiWwuHFtI= X-Google-Smtp-Source: ABdhPJxKZRkyX8J7aD3fsa2WIV/hNAAWLqUEZhXeq7Q5XOtfFNw2XRqK7OteZ467i1KS0VkmBl9vZQ== X-Received: by 2002:adf:ba07:: with SMTP id o7mr58094103wrg.160.1626101161371; Mon, 12 Jul 2021 07:46:01 -0700 (PDT) Received: from [192.168.0.22] (cpc104104-brig22-2-0-cust548.3-3.cable.virginm.net. [82.10.58.37]) by smtp.googlemail.com with ESMTPSA id u15sm19941813wmq.48.2021.07.12.07.46.00 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 12 Jul 2021 07:46:00 -0700 (PDT) To: PHP internals References: <782e08f6-d6a1-e1e7-b2d6-4706277a4d86@gmail.com> Message-ID: Date: Mon, 12 Jul 2021 15:46:00 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-GB Subject: Re: [PHP-DEV] [RFC] [VOTE] is_literal From: rowan.collins@gmail.com (Rowan Tommins) On 11/07/2021 18:00, Dan Ackroyd wrote: >> What it won't do, is tell you when you've forgotten to use it, > Which is a huge difference. You've edited out the crucial last part of that sentence: > but nor would a built-in implementation I don't know how to make this point more emphatically: Neither a built-in literal_concat function, nor setting the internal flag to false when you use the "." operator, can prevent you using plain concatenation in the wrong place. Regardless of what the . operator does to the internal literal flag, the following code will give an error in exactly the same place: // What this line does to the literal flag is irrelevant: $blah = 'a' . 'b'; // This line will set the literal flag to false, but will not raise any errors: $foo = $blah . $_GET['foo']; // $foo is not literal, so $bar is not literal; but there are still no errors: $bar = $foo . '123'; // Finally, an error will be raised when trying to use $bar in literal_concat, regardless of whether it's built-in or user-implemented: $baz = literal_concat($bar, '456'); The only way to put that error in a different place would be if the . operator itself was able to raise errors, and I can't think of any way that would be possible. Regards, -- Rowan Tommins [IMSoP]