Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:60943 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 5746 invoked from network); 22 Jun 2012 21:21:00 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 22 Jun 2012 21:21:00 -0000 Authentication-Results: pb1.pair.com header.from=scott@macvicar.net; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=scott@macvicar.net; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain macvicar.net from 209.85.213.170 cause and error) X-PHP-List-Original-Sender: scott@macvicar.net X-Host-Fingerprint: 209.85.213.170 mail-yx0-f170.google.com Received: from [209.85.213.170] ([209.85.213.170:42082] helo=mail-yx0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 83/41-21324-BB1E4EF4 for ; Fri, 22 Jun 2012 17:21:00 -0400 Received: by yenl12 with SMTP id l12so2238549yen.29 for ; Fri, 22 Jun 2012 14:20:56 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer :x-gm-message-state; bh=860hixjZOdTP3c8YU31GpaqxKIFJn4pWDReEoG4+Zww=; b=JaqAzIpEY2yHaN7eg0cdiJKLLOQOzxtXkxhP8q6vy/2AKULkX9P2hGZ5/QfoY+Y/t/ WoQTVbEXR7E2ryjd0A3KvfhESv+XRstmMo2KZ6xRfajaF2iysLBGEcHKMVEhUYFDpiU2 Jit74JJBq3uDvqr97AWcJgg2LegXwOjxRwB5e2Yf+fjjC4JhapyMMLDFrWW78ItUEvU8 I8LuXAJH8sU7reLPN9fTgMWdGOSN62pCkymQBz+77Uzpf1MIIoOkKIWB080PvsvF8jfV ZbbAPC7XTofsoFnNmiaFhGU6BmUphOtnO1Ji/3CDnnK4JIPPKhKE0NVLaCux5l1+vLTn zt4g== Received: by 10.68.218.7 with SMTP id pc7mr13855470pbc.88.1340400056033; Fri, 22 Jun 2012 14:20:56 -0700 (PDT) Received: from [172.19.20.0] ([173.252.71.7]) by mx.google.com with ESMTPS id io2sm219072pbc.24.2012.06.22.14.20.53 (version=SSLv3 cipher=OTHER); Fri, 22 Jun 2012 14:20:54 -0700 (PDT) Mime-Version: 1.0 (Apple Message framework v1278) Content-Type: text/plain; charset=iso-8859-1 In-Reply-To: <4FE494A9.5040605@php.net> Date: Fri, 22 Jun 2012 14:20:52 -0700 Cc: contact@leo-peltier.fr, internals@lists.php.net Content-Transfer-Encoding: quoted-printable Message-ID: <1AFDB375-2AA5-44F0-997B-5B77614A4FB6@macvicar.net> References: <4FE3759D.4010606@php.net> <4FE449BA.9040108@leo-peltier.fr> <4FE494A9.5040605@php.net> To: Ben Ramsey X-Mailer: Apple Mail (2.1278) X-Gm-Message-State: ALoCoQl4ZKje4Apd0URK8HZVP+wBIShJ1GIapshCspCaWALSeftZQbm1FvUA1Q0muUN4M6VsAmJM Subject: Re: [PHP-DEV] [DRAFT] RFC - array_column() function From: scott@macvicar.net (Scott MacVicar) Hey Ben, On 22 Jun 2012, at 08:52, Ben Ramsey wrote: > On 6/22/12 5:32 AM, L=E9o Peltier wrote: >> Hi, >>=20 >> Shouldn't this be called 'array_pluck'? >> This is the name people usually use when implementing it in PHP (see >> "array_pluck(" vs "array_column(" in Google) or in other = languages/libs >> (see underscorejs, prototypejs and RoR). >>=20 >=20 > I'm open to changing or aliasing the name to array_pluck(), if others = are in agreement. We have a version of this at Facebook and its called array_pull() it has = a third parameter and supports pulling a new key value too. You can find = a copy of it in Phabricator. There is also mpull() which is for methods. = I'd recommend combining the two methods to be honest and doing a single = function that supports index names or a method. = https://github.com/facebook/libphutil/blob/master/src/utils/utils.php#L143= - S=