Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:66094 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 75333 invoked from network); 21 Feb 2013 09:31:14 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 21 Feb 2013 09:31:14 -0000 Authentication-Results: pb1.pair.com header.from=leight@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=leight@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.180 as permitted sender) X-PHP-List-Original-Sender: leight@gmail.com X-Host-Fingerprint: 74.125.82.180 mail-we0-f180.google.com Received: from [74.125.82.180] ([74.125.82.180:51886] helo=mail-we0-f180.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id E2/1B-03224-169E5215 for ; Thu, 21 Feb 2013 04:31:13 -0500 Received: by mail-we0-f180.google.com with SMTP id k14so7306906wer.11 for ; Thu, 21 Feb 2013 01:31:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=2U0lqOyxyTYue8Z1tTFzMMv3uP+szoO9ZePQZVM0/bA=; b=Jc3WLvD64/9u5UTes38qX0uDgruYKit8/d1wZT03IIHGuUGAopF7HA3GjeoKTAghoa hflB9tjnWy6mQphRh7WGdGejj2kkLGPyHpzGw4Vitl12YDF5NhSNQRMe0OoGk2CL73l7 JWiSOZjL6Z/glUsdb6IeAoN/f820KoTzlYZbhRGnpuiCScAzcB6+BWRIMO8xMEWKi9Cd W91+2EQLHlWSw7FpEQgYvwqIOKtN9W72RbGcWIJPKIVnShiFm0rqXzdavZ6htIEPqeoQ NvfxlCts9jmn5SsXLi2HYMde0SUti9oueOBK629T+qxO9P490bgOyI45HU2UjtQqNC3A viNw== MIME-Version: 1.0 X-Received: by 10.180.77.9 with SMTP id o9mr40409472wiw.16.1361439067837; Thu, 21 Feb 2013 01:31:07 -0800 (PST) Received: by 10.217.2.209 with HTTP; Thu, 21 Feb 2013 01:31:07 -0800 (PST) In-Reply-To: References: Date: Thu, 21 Feb 2013 09:31:07 +0000 Message-ID: To: Tjerk Anne Meesters Cc: PHP Internals Content-Type: multipart/alternative; boundary=f46d043d66c30594f204d638bc1a Subject: Re: [PHP-DEV] Pull request for array_filter() improvement From: leight@gmail.com (Leigh) --f46d043d66c30594f204d638bc1a Content-Type: text/plain; charset=ISO-8859-1 On 21 February 2013 07:08, Tjerk Anne Meesters wrote: > Hi, > > I found myself wanting a feature of array_filter() with which I can perform > filtering based on the array key instead of the value. > > With the operative word here being *instead*, keeping in line with the numerous other array functions, would a new function called array_filter_key() with the same signature as array_filter() be more or less appropriate? The callback still being a single parameter function that receives the key *instead* of the value. Is there a big use case for having the key and value both passed to the callback at the same time? (I can't think of anything off the top of my head, but I'm sure someone would use it) --f46d043d66c30594f204d638bc1a--