On 30.08.2014 23:26, Robert Williams wrote:
> If the syntax of heredocs/nowdocs is to be loosened, the biggest aspect I’d
> like to see addressed is indentation. I can certainly see how it would be
> nice to loosen the restrictions around the post-closing-token newline to
> allow easier use in places like array definitions, but, I’ve never run into
> that problem myself. I have, however, been annoyed by the indentation
> limitations, so much so that I could probably count with my fingers the
> number of times that I’ve used the construct in the couple million lines of
> PHP I’ve written — even though I *want* to use it about once a week. I just
> find the side-effect on code formatting, when used in a container structure
> (class, function, method, loop, whatever), to be more than I can handle. Look
> at this simple example from the docs to see what I mean:
>
> [...]
>
> function foo() {
> $string = <<<
> THEEND
> This is the document text. Any
> whitespace appearing in a column
> that’s before the starting token
> is automatically ignored for all
> lines.
> THEEND;
>
That is the only real problem with heredoc/nowdoc for me as well, not
the delimiter (and the reason why I hardly ever used it).
The problem is that I think this could be very confusing. It would be
the typical case of an additional optional argument to a function, but
it might be hard to implement it with an operator.
Greetings,
Florian
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php