On 02/03/2019 19:59, Steven Penny wrote:
3. Add a new method, perhaps "echoln", "println", "say" or similar, that outputs a newline by default
Of the suggestions put forward, this is the only one I can see having any chance of succeeding.
However, I think the big reason this doesn't already exist is one that's been touched on by other responses: PHP started as, and is still primarily regarded as, a language for building websites. In that context, newline characters are generally considered "insignificant whitespace"; the closest equivalent would be appending '<br>' or '<br />' (depending on the dialect of HTML in use), but you're as likely to want "<p>$foo</p>", or "<li>$foo</li>", etc - and that's before we get into the tricky topic of escaping.
Even in CLI scripts, as soon as you're building anything intended for reuse, you're likely to write a function like log_string() which adds information like timestamp, category, severity. The use cases for a new function / keyword may therefore be rather limited.
Regards, -- Rowan Collins [IMSoP] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php