Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:71663 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 73706 invoked from network); 28 Jan 2014 10:01:26 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 28 Jan 2014 10:01:26 -0000 Authentication-Results: pb1.pair.com header.from=ajf@ajf.me; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=ajf@ajf.me; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain ajf.me designates 198.187.29.241 as permitted sender) X-PHP-List-Original-Sender: ajf@ajf.me X-Host-Fingerprint: 198.187.29.241 imap3-1.ox.registrar-servers.com Received: from [198.187.29.241] ([198.187.29.241:45810] helo=imap3-1.ox.registrar-servers.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 76/0B-01140-4FF77E25 for ; Tue, 28 Jan 2014 05:01:25 -0500 Received: from localhost (localhost [127.0.0.1]) by oxmail.registrar-servers.com (Postfix) with ESMTP id 381452A0084 for ; Tue, 28 Jan 2014 05:01:22 -0500 (EST) X-Virus-Scanned: Debian amavisd-new at imap3.ox.registrar-servers.com Received: from oxmail.registrar-servers.com ([127.0.0.1]) by localhost (imap3.ox.registrar-servers.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id m5EX70vegpfo for ; Tue, 28 Jan 2014 05:01:22 -0500 (EST) Received: from app2.ox.registrar-servers.com (unknown [198.187.29.232]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) by oxmail.registrar-servers.com (Postfix) with ESMTPSA id 197A22A007B for ; Tue, 28 Jan 2014 05:01:21 -0500 (EST) Date: Tue, 28 Jan 2014 10:01:21 +0000 (GMT) Reply-To: Andrea Faulds To: internals@lists.php.net Message-ID: <1796143171.126442.1390903281925.open-xchange@app2.ox.registrar-servers.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Priority: 3 Importance: Medium X-Mailer: Open-Xchange Mailer v7.4.1-Rev16 Subject: Lexical scoping From: ajf@ajf.me (Andrea Faulds) Good morning, Perhaps a future version of PHP (PHP 6? 5.7?) could have lexical scoping with a "let" keyword? At the very least, it would make foreach() with a reference less of a problem: foreach ($array as let &$a) { $a = 3; } // $a is not in this scope - no need to worry about accidentally changing last array item Any thoughts? -- Andrea Faulds http://ajf.me/