Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:67719 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 61009 invoked from network); 18 Jun 2013 15:27:08 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 18 Jun 2013 15:27:08 -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 209.85.212.176 as permitted sender) X-PHP-List-Original-Sender: leight@gmail.com X-Host-Fingerprint: 209.85.212.176 mail-wi0-f176.google.com Received: from [209.85.212.176] ([209.85.212.176:56777] helo=mail-wi0-f176.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 4D/54-24847-A4C70C15 for ; Tue, 18 Jun 2013 11:27:07 -0400 Received: by mail-wi0-f176.google.com with SMTP id ey16so3572966wid.3 for ; Tue, 18 Jun 2013 08:27:04 -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=dkD7nxjxT6PyqQALmguo01l1ov5nJM2VotV83peF4hQ=; b=k+XCUDHqlmYkIQzSABCs7EYPbtAtrafXQBd2QIFNsNZqw6xHQPJIloIbBeQJnczVuK 1t681gUgTpiYnihTyZ4Jpx1Db21h3JIw8+fxuiKq3UNKDdIQNPINe7qT67N0oofCMqLF o4AUBAMy6XDwg3P1sAqwWmAkGSCM0sJ7pCaNJbg9dR4GtmIKn7V2fsDDJlFlWmuXXbE3 o8rQil06gQ6BSGKpFwjW9oIUeixD0eWCDXPWc6BSeSiBlEjjmcuhHjcuJlboAuMAXVta MNHPBUsWpb5SmeSdde9J7uH195rX+P+L7RwwsA9aWE7BIvA4UUe8mvZPtgua3r+gPpZR Kw0Q== MIME-Version: 1.0 X-Received: by 10.180.86.4 with SMTP id l4mr4178510wiz.58.1371569224175; Tue, 18 Jun 2013 08:27:04 -0700 (PDT) Received: by 10.216.165.8 with HTTP; Tue, 18 Jun 2013 08:27:04 -0700 (PDT) In-Reply-To: References: Date: Tue, 18 Jun 2013 16:27:04 +0100 Message-ID: To: Sherif Ramadan Cc: PHP Internals Content-Type: multipart/alternative; boundary=f46d04428f42645a6004df6f587a Subject: Re: [PHP-DEV] PR 287 - added use_keys argument to array_filter() [Discussion] From: leight@gmail.com (Leigh) --f46d04428f42645a6004df6f587a Content-Type: text/plain; charset=ISO-8859-1 On 18 June 2013 00:20, Sherif Ramadan wrote: > I'm starting up a thread for discussion on Pull Request 287 > https://github.com/php/php-src/pull/287 (allowing array keys to be passed > to the callback function of array_filter through a third optional boolean > argument). > Why not use array_filter_keys? There are many other array functions that work with keys using this naming pattern. This would make it clearer in the code what is being filtered, and no need for the additional parameter. In this case I think I would still prefer it if the callback took a single parameter. Values can still be easily looked up with $array[$key] in user defined callbacks, but all of the built-in functions that take a single parameter are still available to use. --f46d04428f42645a6004df6f587a--