Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:118677 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 33864 invoked from network); 20 Sep 2022 19:34:53 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 20 Sep 2022 19:34:53 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id B92F8180505 for ; Tue, 20 Sep 2022 12:34:51 -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, 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-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) (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 12:34:51 -0700 (PDT) Received: by mail-wm1-f51.google.com with SMTP id e18so2852779wmq.3 for ; Tue, 20 Sep 2022 12:34:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date; bh=fY2x3lV0dFA68mrnLXbE/KAiBxTvtmjc/Edp1tdwDWQ=; b=aDyKd7W2SjtVQYIF5N2gy7SRx3iAG5wjSLvO47PQ/9w39SAqLXOQBYDgbOE1lvLfRD ppE/s3rJ0WQZZubULs4yNXnmopE2IAJ+Qqw4jTkULGU0cmYuqIT1CIrqfiEaS26MzAAc c8715A9BqgFtWMH7LDyFVMJk5U1LkGdjRgH8VTCkEbGixTKNVxnWUdxmfQ7RHXycaYu1 7fo4xOHsxhF+mkU9R9dy3MeHp78y4OqOm6xHbWor8O8PTzk5e7BWMFNWa1mYQlDV01eh iSrYdRnqDYxJDwZsD3xG/ZPKufFeYdl5oMGTlpc9Xm2mBT+QYGxy4LbQ8gSpq7vNZdar t99g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date; bh=fY2x3lV0dFA68mrnLXbE/KAiBxTvtmjc/Edp1tdwDWQ=; b=O0tei1mPieYTf9YhKsnHcHdGKD6jUsCYngih5/cAPasBa4C6v0mbqNCV5JtZXLbjhf wEYvNVJ5Q9azXLAWrf1RLkv54/scdFz6IJ0eP/x9QHGKEo8hj3qYjismCQteS+3W2UYC 3rOxuVPsZoXle+rFAZIawB1bky/TW7BtLcEN1t87mbxTEYNn4Em+xXfDvGzrFPHWpCEB SvCh95Gs9pICJwLPpncsdgUEv9BjExNIrrPDiYaXZsAyyOkHL1AvZraiAwRSD8bu2lCi yx9TJJfJ5JdEXYsXyhDauFBCR3AauvFboDbWOElHQjBXsszOdzqhXBnoZYfb/Y4apmAM /Cow== X-Gm-Message-State: ACrzQf0JGGKOtWcSogF9HpFi5FdgnZon+96pKoeEGt+sqQE8AyC7mKjl SpKjg/a4R3agnyFMz91rLRKOoA4SGzk= X-Google-Smtp-Source: AMsMyM7MxW9NFQ1+RGTvLBOk2OuK5YRUH6Ym8e+OiEdT4jOxR/i6VQKuV6zulRaprqzqsKzH6FBVww== X-Received: by 2002:a05:600c:3d8a:b0:3b4:a4e1:8661 with SMTP id bi10-20020a05600c3d8a00b003b4a4e18661mr3583856wmb.30.1663702489972; Tue, 20 Sep 2022 12:34:49 -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 o2-20020a05600c510200b003a540fef440sm833768wms.1.2022.09.20.12.34.49 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 20 Sep 2022 12:34:49 -0700 (PDT) Message-ID: <1d4ffc2a-b636-2c4b-aaf2-4c448312bcaf@gmail.com> Date: Tue, 20 Sep 2022 20:34:47 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.2.2 Content-Language: en-GB To: internals@lists.php.net References: In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [PHP-DEV] One-line heredoc for better syntax highlightning From: rowan.collins@gmail.com (Rowan Tommins) On 20/09/2022 19:29, Olle Härstedt wrote: > 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. For what it's worth, the "they" in question are the authors of the early Unix shells in the 1970s - from a quick search, it seems like the Bourne shell was the first to implement "here document" syntax, sometime around 1979. As the name suggests, they were not for defining strings, but for entering entire text files embedded in a script or interactive shell session. In that context, the original format is actually elegantly minimal: content is read one line at a time; if it exactly matches the delimiter, stop; else, add the line to the file buffer. No actual parsing is required. Regards, -- Rowan Tommins [IMSoP]