On 29/06/2021 17:15, Manuel Canga wrote:
Hi, folks, here again with a new purpose:  ``` as alternative to Nowdoc syntax.

Currently, Nowdoc syntax is very "verbose":

$string =<<<'CODE'
<div>
<p>Link: <a href="%s">'%s'</a><p>
</div>
CODE;


The big advantage of heredoc and nowdoc syntax is that you can choose the delimiter to be something that you know won't occur in the string. For instance:

$markdown = <<<'MD'
PHP has lots of ways to write strings:
```
$example = 'hello';
$example = "hello";
$example = <<<EXAMPLE
hello
EXAMPLE;
$example = <<<EXAMPLE
hello
EXAMPLE;
```
MD;


Unless I'm missing something, your proposed syntax would just be a *more verbose* way of writing single quotes.


Regards,

--
Rowan Tommins
[IMSoP]

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

Reply via email to