On 30/06/2021 11:51, Manuel Canga wrote:
I see this purpose as a simplification of Nowdocs. Just like `[]` with 
`array()`.


A 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]

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: https://www.php.net/unsub.php

Reply via email to