Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:61205 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 78757 invoked from network); 13 Jul 2012 16:18:12 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 13 Jul 2012 16:18:12 -0000 Authentication-Results: pb1.pair.com smtp.mail=julienpauli@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=julienpauli@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.213.42 as permitted sender) X-PHP-List-Original-Sender: julienpauli@gmail.com X-Host-Fingerprint: 209.85.213.42 mail-yw0-f42.google.com Received: from [209.85.213.42] ([209.85.213.42:58044] helo=mail-yw0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id D2/29-17670-34A40005 for ; Fri, 13 Jul 2012 12:18:12 -0400 Received: by yhoo21 with SMTP id o21so3062777yho.29 for ; Fri, 13 Jul 2012 09:18:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; bh=4orHZXTPuVFmdvNO4xzl7PiSw8D/G89toFeZJcEI/ts=; b=EMrWWBG4wzGpvJZtuEUbL5EU6fkapasUzRWB/A32y/IWDMZWxVFFYGYHnGE0iFeZ0C pAKnXAl0Mf51CxjQSsund/7rL2pH4WG9ZBWVUBK/MUH+TajNZHvK6gcVtqBqcvZi8eCW r53jJELPS+TSeFqlTXYc5/NXMLYPOLRDIP2lftsqGW2xZUSR2gluZAdIQvvMQVivphsy xt0IaqTs1RWQs5/1f6IyMSnDTeQodf9bl3k2kxYCjzN4R2C/RITEXrVystmYfa9UGdvX 1iFZPQiNKJiUihHWBkcyEYUlxudTkDCcILn242QFjYrfNagFAaV7TI4EvmVKBZAv/jII ZowQ== Received: by 10.50.104.168 with SMTP id gf8mr1489974igb.62.1342196288924; Fri, 13 Jul 2012 09:18:08 -0700 (PDT) MIME-Version: 1.0 Sender: julienpauli@gmail.com Received: by 10.64.23.74 with HTTP; Fri, 13 Jul 2012 09:17:28 -0700 (PDT) In-Reply-To: References: Date: Fri, 13 Jul 2012 18:17:28 +0200 X-Google-Sender-Auth: o2zFLbfSppJlRYqz-N1jm2xHawI Message-ID: To: Andrew Faulds Cc: internals@lists.php.net Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: [PHP-DEV] [request #48542] addition of optional second parameter to array_shift/array_pop which gives key From: jpauli@php.net (jpauli) On Fri, Jul 13, 2012 at 6:11 PM, Andrew Faulds wrote: > Hi there, > > I saw this bug report (feature request): https://bugs.php.net/bug.php?id=48542 > > The person there proposes that array_shift and array_pop should have > an optional second parameter, which can be passed a reference to a > variable in which the key can be returned, so you can pop the key and > value at the same time, rather than having to get the key first, then > pop the pair to get the value. > > Thoughts? I'm new to PHP development, I thought this might be a useful > feature that I could relatively easily implement. Also, I can > personally see how this could be useful having used arrays as > essentially look-up tables before. I'm +1 as this may be useful and there is no BC break. Julien