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

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to