Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:118674 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 25249 invoked from network); 20 Sep 2022 18:29:32 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 20 Sep 2022 18:29:32 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 4BD5F180380 for ; Tue, 20 Sep 2022 11:29:32 -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, 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-lf1-f48.google.com (mail-lf1-f48.google.com [209.85.167.48]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Tue, 20 Sep 2022 11:29:31 -0700 (PDT) Received: by mail-lf1-f48.google.com with SMTP id u18so5245592lfo.8 for ; Tue, 20 Sep 2022 11:29:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:from:to:cc:subject:date; bh=OTJxXP7hmSM1BwC3MOXmsDlOkymWJ3pDdKGyQi6sVbI=; b=N7juvwU9BEAcVPpY03fSUsiRJEAruVSaKQ1I2rBl8UUvy3QfMtLgGbxDySq2alHWRk X5AAJqCcGcSr3bPR22oH221jUJ4DXBeJHC4UN9lZLpWWhY36G+7lIEHz3fnzbSB+yi6B Ln/PP09DkU1pf5sgqvwkwHsrWVVOcxRwdtzS3yaaML/EHFVQ/Iuqe3sAlV+KRMBix3R9 sVkwuJCK0C1379oBYndEzGEu2v3EUJN3RJ4lUSC1wMrGNS4WZrRenmopSSvoY/T96oHO 26j/Cat8g6o0ByBnf2yDpNvfuwAGeIBbBLnU2x4HAzN96NhOzZwz54B+RNun0y/JYp85 XTaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:x-gm-message-state:from:to:cc :subject:date; bh=OTJxXP7hmSM1BwC3MOXmsDlOkymWJ3pDdKGyQi6sVbI=; b=FLJ5yHwRl7BiP9HGWnQiTzslzqe3RODXITgu6kALEjtBrKQO/L9Sg9e8eUbVXy2DYE p+bW+jTFXVgQdHp1QUG3HjQAKJoyfiKfCmHhkrS1B/Fr2HTbDR1TG6MGgE+LneKMmien ex6cbHe0MEgCwjTfajDvWkeMYTJos8WxWQsZYn65Uv3K5V/1HZsRcE11S4J+rivDt5N6 GHP/PiZJ/xKjkrB9eCLcFmVmAhJueuXbGVGVEr1gzT76gBZUOK/p/EF0/Pn32q+9Tjjy APHA4prd1MojfOPjMpGOej+BJV7hatEPMQ7juYZfrofeDhK10xUGiaCBqlNFvu/b66Hv Ihww== X-Gm-Message-State: ACrzQf0ZDeCwUtHBd2onsYvlr79uN6m+S+Kguib+d/uF5gA4PKaA2m+F WT8B2H8fEAxiPN40TVMhmZQ8wocTOOexiVEDnw0= X-Google-Smtp-Source: AMsMyM6HvnKL3FrPP8MJGmQSxU9LTQdAWpD5RX+7yGiEsSCgXwiIIajPNgRzGp6QMw1yIuSSGMcnQ37I+qpDV6ICJ/w= X-Received: by 2002:a05:6512:32c7:b0:49f:53f2:a51a with SMTP id f7-20020a05651232c700b0049f53f2a51amr8736720lfg.236.1663698570240; Tue, 20 Sep 2022 11:29:30 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a2e:5303:0:0:0:0:0 with HTTP; Tue, 20 Sep 2022 11:29:29 -0700 (PDT) In-Reply-To: References: Date: Tue, 20 Sep 2022 20:29:29 +0200 Message-ID: To: Rowan Tommins Cc: internals@lists.php.net Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] One-line heredoc for better syntax highlightning From: olleharstedt@gmail.com (=?UTF-8?Q?Olle_H=C3=A4rstedt?=) 2022-09-20 11:54 GMT+02:00, Rowan Tommins : > On 19/09/2022 20:10, Olle H=C3=A4rstedt wrote: >> More for users to learn? Don't you mean less, haha? This is an >> arbitrary limitation of heredoc, that we can remove (it might not be >> arbitrary from a yacc perspective, someone would have to explain that >> if so). > > > I don't think the rules for heredoc are arbitrary, but they are quite > specific: the end delimiter has to appear at the *start* of a line, so > it can appear anywhere else in the text without prematurely ending the > string: > > $foo =3D << This is a normal heredoc > this is not the end FOO > this is: > FOO; Ya ok, this kills my idea. If heredoc was designed from start so that the delimiter would not be allowed at all in the text, then it would make sense. Weird that they did it like that, would be easy enough to come up with a unique delimiter so that it would not cause a problem... Obviously it can't be changed now without breaking backwards compatibility. Our product still supports PHP 7.2 sadly, but that's our own problem. :) Thank you. Olle