Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:101887 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 45406 invoked from network); 18 Feb 2018 23:47:27 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 18 Feb 2018 23:47:27 -0000 X-Host-Fingerprint: 95.150.120.34 unknown Received: from [95.150.120.34] ([95.150.120.34:3106] helo=localhost.localdomain) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id DE/1A-26725-E801A8A5 for ; Sun, 18 Feb 2018 18:47:27 -0500 Message-ID: To: internals@lists.php.net References: Date: Sun, 18 Feb 2018 23:47:23 +0000 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:49.0) Gecko/20100101 Firefox/49.0 SeaMonkey/2.46 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Posted-By: 95.150.120.34 Subject: Re: Suggested change: change priority of new and -> From: ajf@ajf.me (Andrea Faulds) 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/