Hello, On Mon, Jan 18, 2010 at 5:27 PM, Stanislav Malyshev <s...@zend.com> wrote: > I wrote a small patch that enables this kind of syntax in PHP: > > foo()(); > ...
I think language enhancements with no BC breaks that offer a wider toolset to programmers is a good thing. I would also like to see the other ideas in this thread implemented such as array access & object creation. The only thing I do not like about this is I do not beleive it fits the PHP error model. Lets just say Bar::foo($arg) returns a function callback or FALSE/NULL on a error condition. So you end up with a function call to something that is not callable, the PHP way under this case is to have a fatal error. I would rather not see more ways to cause fatal errors in PHP (call to undefined method has gotten a bit more popular since object chaining has risen in popularity as well). Of course I know exceptions are likely out of the question for these kinds of cases as well. These thoughts do not apply to array access or object creation. Regards, -Chris -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php