Re: [RFC] Flexible Heredoc and Nowdoc Syntaxes
| From: | Thomas Punt | Date: | Sat, 28 Oct 2017 11:17:37 +0000 |
| Subject: | Re: [RFC] Flexible Heredoc and Nowdoc Syntaxes | ||
| References: | 1 2 3 4 5 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-100977@lists.php.net to get a copy of this message | ||
Hi Stephen,
> I disagree. To me this change would simply mean that the literal exact white-space string
> preceding the end marker is removed as a prefix from all lines.
>
> So if you have an end marker intended by two tab characters, but all the ‘content’ lines of
> the heredoc are indented by 8 spaces, nothing is removed.
So let's say the ending marker is indented with [space][tab][space] and the body is indented
with [tab][space][tab], by your logic, a [space] and a [tab] should be removed from the body's
indentation? Or nothing at all?
The problem with such rules is that they bring more complication to the implementation when it comes
down to the finer details. It is far better to simply disallow such nonsense to begin with.
A nice benefit of this (choosing a stricter approach to begin with) is that, should we see
advantages to bringing more leniency to the current semantics (such as enabling the mixture of tabs
and spaces), then we can enable this later without causing any new BC breaks. Whereas if we
introduce a really loose-style syntax to begin with, then we cannot make it stricter later on
without introducing new BC breaks.
-Tom