[RFC] Alternative syntax for Nowdoc.
| From: | Manuel Canga | Date: | Tue, 29 Jun 2021 16:15:19 +0000 |
| Subject: | [RFC] Alternative syntax for Nowdoc. | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-115213@lists.php.net to get a copy of this message | ||
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;
Why doesn't something like this?:
$string =```
<div>
<p>Link: <a href="%s">'%s'</a><p>
</div>
```;
even as well:
$string =``
<div><p>Link: <a
href="%s">'%s'</a><p></div>``;
I see a caveat: this is very similar to eval syntax. However, this syntax is more
similar to Markdown syntax.
What do you think ?
Regards
Manuel Canga