On Wed, 11 Aug 2010 15:37:01 +0100, Johannes Schlüter
<johan...@schlueters.de> wrote:
On Wed, 2010-08-11 at 15:29 +0100, Gustavo Lopes wrote:
> * What about allowing properties with function names as
strings or
> array($obj_or_class, 'method'), won't that be needed for
being
> consistent with local variables?
Well, you cannot do "$a = 'phpinfo'; $a();" as well, so it's
consistent with that. I think what you refer to would only make sense
if that were allowed.
You can. This is valid.
OK, I know where I got this idea. "$a = 'phpinfo'; $a();" is actually the
only valid case. array callbacks or 'Foo::bar' are forbidden.
In order to be called as instance methods, the closure properties needs to
have a bound instance -- preferably -- very preferably -- the instance
where the closure is stored. In this case, it doesn't make sense to allow
'function' to be called, because then we wouldn't have anything with which
to fill the $this pointer.
I guess it could make some sense for static calls, though.
--
Gustavo Lopes
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php