Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:67955 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 68552 invoked from network); 27 Jun 2013 14:58:17 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 27 Jun 2013 14:58:17 -0000 Authentication-Results: pb1.pair.com header.from=nikita.ppv@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=nikita.ppv@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.214.175 as permitted sender) X-PHP-List-Original-Sender: nikita.ppv@gmail.com X-Host-Fingerprint: 209.85.214.175 mail-ob0-f175.google.com Received: from [209.85.214.175] ([209.85.214.175:55916] helo=mail-ob0-f175.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 0B/17-34034-8035CC15 for ; Thu, 27 Jun 2013 10:58:16 -0400 Received: by mail-ob0-f175.google.com with SMTP id xn12so821542obc.20 for ; Thu, 27 Jun 2013 07:58:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=grluT77v9hWhjNImLpBWKWXBlZOQGbj6t7ptd9nepi0=; b=AnFZnoPNucuk5J7RFoIUtT6JLWwSca19mlAZdOm90TJbbTR+vs24HncItftRd07m+Q qITwvtoaVNwcpI0/kNh7smwzyMddyR227tNBuQhiPuSCIjt4df4oM5epLpdXyRuMN0gE MozlxXQiLWfwOp0MzCrPFYthSmqFdLFyFkaETVQzCK85TjF6vUo9JnKy1/SGxH5kQfZg KlmjYIx1JDjPvHBH+weDQv1jYHY0kfoALIT7pwonNsMta41muynBWbszz6ypCBSBWdvt sDpUizEO7IH28njO0W5wWQubY1BWVY/0Ok/ePkpEt56f6NGLOvevZUlAlIQf3kU3MOJp UY8Q== MIME-Version: 1.0 X-Received: by 10.182.16.137 with SMTP id g9mr4307279obd.17.1372345093212; Thu, 27 Jun 2013 07:58:13 -0700 (PDT) Received: by 10.182.89.170 with HTTP; Thu, 27 Jun 2013 07:58:13 -0700 (PDT) In-Reply-To: <4ED7146272E04A47B986ED49E771E347BB4DF6F344@Ikarus.ameusgmbh.intern> References: <4ED7146272E04A47B986ED49E771E347BB4DF6F344@Ikarus.ameusgmbh.intern> Date: Thu, 27 Jun 2013 16:58:13 +0200 Message-ID: To: Christian Stoller Cc: "internals@lists.php.net" Content-Type: multipart/alternative; boundary=001a11c330ecca53a804e023fd76 Subject: Re: [PHP-DEV] New syntax for multidimensional array loop with foreach From: nikita.ppv@gmail.com (Nikita Popov) --001a11c330ecca53a804e023fd76 Content-Type: text/plain; charset=ISO-8859-1 On Thu, Jun 27, 2013 at 4:10 PM, Christian Stoller wrote: > The new syntax could make it shorter and faster to write... but maybe it's > a bit too confusing? > > $count = 0; > foreach ($array as $key => $innerArray as $innerKey => $value) { > $count += $value; > // and do something with $key and $innerKey > } > I'm against this feature. It makes the code marginally shorter, but a good bit less readable. Combined with the break/continue issue, I don't think we gain anything by introducing this syntax. Nikita --001a11c330ecca53a804e023fd76--