Re: [PHP-DEV] [RFC] Loosening heredoc/nowdoc scanner

[email protected] (Tjerk Meesters)
Newsgroups php.internals
Message-ID <[email protected]>
On 31 Aug, 2014, at 6:12 am, Stas Malyshev <[email protected]> wrote:

> Hi!
> 
>> There’s no real objective measure with which I can answer such
>> questions :)
>> 
>> The closest I could come to a rebuttal is if there’s no real need to
>> make the syntax so restrictive, why not make it less restrictive?
> 
> "Why not" is usually not a very good reason for a change in the language
> syntax. There is, however, a reason why it is restrictive - so that
> there would be less chance for the end tag to collide with the actual
> text being heredoc'ed, and so that the end of the text would be clearly
> demarcated (since the text itself, being taken verbatim, can not be
> properly indented/delimited within the text).

I agree, but I can see how this argument is going in circles; my point (and that of Nikita) is that if the enclosure naturally occurs within the quotation, it’s a bad enclosure and a better one should be picked. The rule of requiring a newline directly following the closing delimiter is more of a hindrance than it is helpful imo.

> 
> My belief is that the change have positive value of "changing something
> for the better minus changing something for the worse" and so far I'm
> not really convinced as of now that this change has it, especially given
> the BC break potential.
> -- 
> Stanislav Malyshev, Software Architect
> SugarCRM: http://www.sugarcrm.com/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.