Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:68058 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 84659 invoked from network); 3 Jul 2013 20:01:42 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 3 Jul 2013 20:01:42 -0000 Authentication-Results: pb1.pair.com smtp.mail=me@chrislondon.co; spf=unknown; sender-id=unknown Authentication-Results: pb1.pair.com header.from=me@chrislondon.co; sender-id=unknown Received-SPF: unknown (pb1.pair.com: domain chrislondon.co does not designate 209.85.212.48 as permitted sender) X-PHP-List-Original-Sender: me@chrislondon.co X-Host-Fingerprint: 209.85.212.48 mail-vb0-f48.google.com Received: from [209.85.212.48] ([209.85.212.48:64453] helo=mail-vb0-f48.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 9E/80-15343-52384D15 for ; Wed, 03 Jul 2013 16:01:42 -0400 Received: by mail-vb0-f48.google.com with SMTP id w15so449943vbf.35 for ; Wed, 03 Jul 2013 13:01:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-originating-ip:date:message-id:subject:from:to :content-type:x-gm-message-state; bh=gubPMZHeLGwkRStTI1sMjAW6GNVxmQgnqUfP0dtOLoo=; b=EKNWxMvx3HjAV1RZ2vN/Ms0OMZlAtX4ukXlfxq/NfdprsFRkibHiad53FlX406fG0Q 1KxCvhAViFvNZxHSHuLU22CPgVw9Aq5PyEoR/i8eGv0CnYW0rg3kR+60aAYs0kvXF6If gO5K+pZhU/RoU7ofBmZaHQUdj2hIAKW5Kic95VT1Ch3yYEzr9taO/n8oLykoPzYMyBj6 kVgS1E6eZklD9OPXzHdT3VCGpPCOwP35bJ2REEu5EIu5L6b/rvKHZDgCfA7HhBfdOmMJ aWonSmJwAmF+6hrD8hL5hcF3L208MyfAYuFqkfUle/7IGYQM7/+2NH4FvtYH7OBebfRz iYMw== MIME-Version: 1.0 X-Received: by 10.220.59.69 with SMTP id k5mr778732vch.34.1372881698571; Wed, 03 Jul 2013 13:01:38 -0700 (PDT) Received: by 10.58.7.36 with HTTP; Wed, 3 Jul 2013 13:01:38 -0700 (PDT) X-Originating-IP: [66.219.207.210] Date: Wed, 3 Jul 2013 14:01:38 -0600 Message-ID: To: internals@lists.php.net Content-Type: multipart/alternative; boundary=001a11c2012cf65d3c04e0a0edbf X-Gm-Message-State: ALoCoQliktS3ubK88ossuG5U0VDbczPNqT9g7jrq2HSyzAQCQcrNGu5TSnEv51E5qSVA+Hz7hNnQ Subject: New feature: additional syntax proposal for Foreach From: me@chrislondon.co (Chris London) --001a11c2012cf65d3c04e0a0edbf Content-Type: text/plain; charset=ISO-8859-1 Hello community, This is my first post here. I hope to improve my participation in the community and give back to the technology that has done so much for my career. My first attempt is to propose an additional syntax for the Foreach statement. Background: There are times in our code where we can leave things blank that we don't need, such as: for ( ; ; ) { } - and - list( , $foo, $bar) = array('ignore', 'myFoo', 'myBar'); Proposal: I have found over the years that there are times when I want to loop through an associative array but I don't need the value. I would like to allow the following syntax: foreach ($array as $key => ) { } Please let me know your thoughts. Thanks Chris London --001a11c2012cf65d3c04e0a0edbf--