Re: Variable scopes for language constructs (foreach, ...)

From: Date: Thu, 23 Jun 2011 19:52:49 +0000
Subject: Re: Variable scopes for language constructs (foreach, ...)
References: 1 2 3 4 5 6  Groups: php.internals 
Request: Send a blank email to internals+get-53549@lists.php.net to get a copy of this message
On Thu, 23 Jun 2011, Chris Stockton wrote: > On Thu, Jun 23, 2011 at 8:49 AM, Martin Scotta <martinscotta@gmail.com> wrote: > >  Martin Scotta > >> > > foreach ($values as $value) { > >  // use $value > > } > > unset ($value); // <-- unset done inside core > > > > foreach ($values as $key => $value) { > >  // use $key and $value > > } > > unset ($key, $value); // <-- unset done inside core > > > > will this just do the trick? > > > > I think proposed change is extremely counter intuitive to the design > of PHP in regard to scoping and would be a very large bc break, PHP is > doing exactly what it is suppose to do here and I wouldn't want it any > other way. I totally agree. Derick -- http://derickrethans.nl | http://xdebug.org Like Xdebug? Consider a donation: http://xdebug.org/donate.php twitter: @derickr and @xdebug

« previous php.internals (#53549) next »