Re: Call closure stored as object property directly without use of temporary variable
| From: | Stas Malyshev | Date: | Sat, 08 Dec 2012 22:05:21 +0000 |
| Subject: | Re: Call closure stored as object property directly without use of temporary variable | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-64200@lists.php.net to get a copy of this message | ||
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.
--
Stanislav Malyshev, Software Architect
SugarCRM: http://www.sugarcrm.com/
(408)454-6900 ext. 227