Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:53549 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 11371 invoked from network); 23 Jun 2011 19:52:53 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 Jun 2011 19:52:53 -0000 Authentication-Results: pb1.pair.com header.from=derick@php.net; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=derick@php.net; spf=unknown; sender-id=unknown Received-SPF: unknown (pb1.pair.com: domain php.net does not designate 82.113.146.227 as permitted sender) X-PHP-List-Original-Sender: derick@php.net X-Host-Fingerprint: 82.113.146.227 xdebug.org Linux 2.6 Received: from [82.113.146.227] ([82.113.146.227:46795] helo=xdebug.org) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 63/E4-19628-499930E4 for ; Thu, 23 Jun 2011 15:52:52 -0400 Received: from localhost (xdebug.org [127.0.0.1]) by xdebug.org (Postfix) with ESMTPS id 070F7DE140; Thu, 23 Jun 2011 20:52:50 +0100 (BST) Date: Thu, 23 Jun 2011 20:52:49 +0100 (BST) X-X-Sender: derick@whisky To: Chris Stockton cc: Martin Scotta , Stefan Neufeind , internals@lists.php.net In-Reply-To: Message-ID: References: <4E0355AE.4080305@php.net> <4E035B7E.4010703@php.net> User-Agent: Alpine 2.02 (DEB 1266 2009-07-14) MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="8323328-822180726-1308858770=:3774" Subject: Re: [PHP-DEV] Variable scopes for language constructs (foreach, ...) From: derick@php.net (Derick Rethans) --8323328-822180726-1308858770=:3774 Content-Type: TEXT/PLAIN; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE On Thu, 23 Jun 2011, Chris Stockton wrote: > On Thu, Jun 23, 2011 at 8:49 AM, Martin Scotta w= rote: > > =C2=A0Martin Scotta > >> > > foreach ($values as $value) { > > =C2=A0// use $value > > } > > unset ($value); // <-- unset done inside core > > > > foreach ($values as $key =3D> $value) { > > =C2=A0// use $key and $value > > } > > unset ($key, $value); // <-- unset done inside core > > > > will this just do the trick? > > >=20 > 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 --=20 http://derickrethans.nl | http://xdebug.org Like Xdebug? Consider a donation: http://xdebug.org/donate.php twitter: @derickr and @xdebug --8323328-822180726-1308858770=:3774--