Re: PATCH: anonymous functions in PHP

From: Date: Mon, 19 Mar 2007 21:53:14 +0000
Subject: Re: PATCH: anonymous functions in PHP
References: 1 2 3 4 5 6 7 8 9 10 11 12 13 14  Groups: php.internals 
Request: Send a blank email to internals+get-28458@lists.php.net to get a copy of this message
> 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. S

« previous php.internals (#28458) next »