Re: [RFC] Flexible Heredoc and Nowdoc Syntaxes
| From: | Thomas Punt | Date: | Fri, 27 Oct 2017 18:31:14 +0000 |
| Subject: | Re: [RFC] Flexible Heredoc and Nowdoc Syntaxes | ||
| References: | 1 2 3 4 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-100971@lists.php.net to get a copy of this message | ||
Hi,
> If developers accidentally add/subtract leading space from the closing token then the whole
> string changes;
Yes, this is a feature of the chosen semantics. The indentation level of the body can be chosen
based upon the current indentation level of the code (for which, the closing marker should be lined
up to), not the indentation level from the start of the line (which may cause developers to indent
the body text less to prevent leading whitespace, leading us back to the current situation of having
indentation levels ruined by these syntaxes).
> this can lead to subtle bugs and annoyances.
I think this clause is a little too exaggerated. Once a developer understands that the closing token
guides the indentation level of the body text, then the cause of the change in whitespace should be
pretty obvious (if it's not already visually obvious from the fact that they must have broken
the indentation level of their own code).
-Tom