Re: [RFC] Alternative syntax for Nowdoc.
| From: | Rowan Tommins | Date: | Wed, 30 Jun 2021 11:31:32 +0000 |
| Subject: | Re: [RFC] Alternative syntax for Nowdoc. | ||
| References: | 1 2 3 4 5 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-115237@lists.php.net to get a copy of this message | ||
On 30/06/2021 11:51, Manuel Canga wrote:
I see this purpose as a simplification of Nowdocs. Just likeA PHP code base might have thousands of array literals, some of which will be very short, and maybe nested inside each other. That makes the saving of 5 characters per literal add up to a big difference across the code base. On the other hand, nowdocs will generally be for long strings (otherwise, a single- or double-quoted string would be more concise anyway), and will happen a handful of times across the code base. Saving 5 characters per nowdoc (``` instead of <<<'EOF') is therefore a much more minor difference. In exchange for that small gain, we'd be adding an extra rule in every PHP parser (IDEs, code style tools, etc), and an extra thing for new developers to understand (the documentation for how to write strings is already long enough to get bored halfway through). I think there is more cost than benefit. Regards, -- Rowan Tommins [IMSoP][]witharray().