Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:66693 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 26300 invoked from network); 19 Mar 2013 07:26:05 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Mar 2013 07:26:05 -0000 X-Host-Fingerprint: 92.103.172.102 unknown Date: Tue, 19 Mar 2013 02:26:04 -0500 Received: from [92.103.172.102] ([92.103.172.102:16712] helo=localhost.localdomain) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 20/05-17382-B0318415 for ; Tue, 19 Mar 2013 02:26:04 -0500 Message-ID: <20.05.17382.B0318415@pb1.pair.com> To: internals@lists.php.net References: User-Agent: Pan/0.136 (I'm far too busy being delicious; GIT 926a150 git://git.gnome.org/pan2) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Posted-By: 92.103.172.102 Subject: Re: [PHP-DEV] __invokeStatic() method From: bruno@chalopin.fr (Bruno CHALOPIN) Hi, Le Mon, 18 Mar 2013 09:07:43 +0200, Matīss Roberts Treinis a écrit : > Not only that. This potentially might break compatibility with many > software products already out there. I don't see how it could break existing software as it is not a modification of an existing method but a brand new one. > Also, this might lead to many > misunderstandings and, in fact, ambiguous code. Consider the sample. > > $name = 'something'; > $something = $name(); // What is this - a function call or object? > > Fact is, we can not know that unless a) do a search in code b) var_dump? As long as you use syntax like $foo = new $bar() or $foo = $bar(), you'll always wonder if the function/class behind $bar exist or not, etc... And it is easy to remove any ambiguity by using $something = $functionName () or $something = $className() or add proper comments. It's only up to the dev. I find that __invokeStatic() could be a quite cool syntactic sugar. My 2 cents. Bruno