On Sat, Dec 8, 2012 at 5:05 PM, Stas Malyshev <smalys...@sugarcrm.com>wrote:

> Hi!
>
> > Has anyone else wanted this functionality? Has anyone else thought of
> ideas
> > of addressing this (or come to the conclusion it really isn't safely
> > addressable without causing disproportionate amounts of grief?)
>
> Yes, there were people that wanted this functionality, but since having
> the same thing ($foo->bar()) mean two different things (call method
> named "foo" vs. "fetch property named foo and then call it if it's
> callable") is not a good idea this wasn't done.
> In some languages, the options above are the same - i.e. methods and
> properties are actually the same thing - but in PHP is is not so, and
> can be made so without some BC-breaking changes.
>

As it stands now, calling a method can mean two different things: calling
the method directly, or handling the method invocation within __call().
Checking for a method first, a closure instance next, and then falling
through to __call() seems like it would have been a reasonable approach.

That said, as you mention BC-breaking is now an issue.

Thanks,

Adam

Reply via email to