Hi,
I'm not… quite sure if it changes anything, but it seems worth pointing
out PHP has two syntaxes for `new`. You can do `new DateTime()`, but you
can /also/ do `new DateTime` without the brackets.
So, while you can't do `new DateTime()->format(DATE_ATOM)`, you *can* do
`(new DateTime)->format(DATE_ATOM)`. This is just as short. It's only
for constructor calls requiring arguments that we get the problem.
It also makes me wonder if it's not dereferenceable because then `new
DateTime()` would be ambiguous: is it constructing a DateTime, or is it
invoking a newly-constructed DateTime as a function? Be aware that
__invoke can be implemented by a class to make its objects callable.
Thanks!
--
Andrea Faulds
https://ajf.me/
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php