Re: PATCH: anonymous functions in PHP
| From: | Peter Hodge | Date: | Tue, 20 Mar 2007 00:15:31 +0000 |
| Subject: | Re: PATCH: anonymous functions in PHP | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-28475@lists.php.net to get a copy of this message | ||
--- Sean Coates <sean@caedmon.net> wrote:
> > I'm not arguing the preservation of the exact value of $rev when the
> > anonymous function was created (as would be the case with a closure).
> > I'm thinking of the variable being whatever is defined in the parent
> > regardless. As in my proposal, the seek could search all the way up to
> > the top in which case the $rev would be found if it had been defined as
> > expected. At any rate, I guess this is diverging from the real
> > discussion of anonymous functions :)
>
> If you've ever tried to hack on the source to anything that you didn't
> write that also uses globals throughout (Gallery2, for example), you
> know how hard it is to track down a single layer of scope that can be
> defined [somewhere else].
>
> Tracking this up the chain like a bubbled exception sounds like a
> nightmare for debugging/comprehension, and IMO it's too magical.
>
> One layer of scope might be useful: $_PARENT ?
> More than that, and my head starts to hurt.
echo $_PARENT['_PARENT']['_PARENT'][...]
;-)
- Peter
>
> S
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
Send instant messages to your online friends http://au.messenger.yahoo.com