Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:72344 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 88855 invoked from network); 6 Feb 2014 15:53:48 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 6 Feb 2014 15:53:48 -0000 Authentication-Results: pb1.pair.com smtp.mail=robin@kingsquare.nl; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=robin@kingsquare.nl; sender-id=pass Received-SPF: pass (pb1.pair.com: domain kingsquare.nl designates 141.138.142.202 as permitted sender) X-PHP-List-Original-Sender: robin@kingsquare.nl X-Host-Fingerprint: 141.138.142.202 spring.kingsquare.nl Linux 2.6 Received: from [141.138.142.202] ([141.138.142.202:33593] helo=spring.kingsquare.nl) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id CC/04-00209-A00B3F25 for ; Thu, 06 Feb 2014 10:53:47 -0500 X-No-Relay: not in my network Received: from mail-ve0-f180.google.com (mail-ve0-f180.google.com [209.85.128.180]) by spring.kingsquare.nl (Postfix) with ESMTPSA id 011B7E9D068 for ; Thu, 6 Feb 2014 16:53:42 +0100 (CET) Received: by mail-ve0-f180.google.com with SMTP id db12so1604506veb.25 for ; Thu, 06 Feb 2014 07:53:41 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=THU03nvPjJzbLVI8H8q+Tt3EFwxoKx7gprTdhyWrGNY=; b=DEUeZ3PqaV6MHjttcb5IosLMiODefrJ8Me1VCzMVkqXPiwJfOAl2tDp+Jo+IU7E4DU OQkSW92tqB92ILoocCddJq5qPpkemCWSfCoMnWThZ7cMJX6NvoeXtSyhw2rBYLyfhR9Y DXq1Bm0/aAyd4/NgAyMWZ0j0Bezfobj3IsykvAQpxquPmcNdfl3PcDVpVjv2zojMo4Gm swyRAyxIZGt6mNJoOFbiTDvxsoOXzJCsoroBSY4dXgqLwmSLaNHXfIZXhjVVrpINqf1b aN/JtoqDi4OApK4cLdrCRnAVYlwynIHMWVstV/mZ73emnKbMfjXsjISam0XlmG7My3DT XfGg== X-Received: by 10.52.164.203 with SMTP id ys11mr1603073vdb.37.1391702021542; Thu, 06 Feb 2014 07:53:41 -0800 (PST) MIME-Version: 1.0 Received: by 10.220.125.4 with HTTP; Thu, 6 Feb 2014 07:53:21 -0800 (PST) In-Reply-To: References: Date: Thu, 6 Feb 2014 16:53:21 +0100 Message-ID: To: Tjerk Meesters Cc: PHP Internals Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] [discussion] add array_usearch() From: robin@kingsquare.nl ("Kingsquare.nl - Robin Speekenbrink") 2014-02-06 Tjerk Meesters : > Hi internals, > > To complement array_search(), I'm gauging the interest in adding the > following function: > > mixed array_usearch(array $haystack, callable $fn, int $flags = 0) > > It returns the first array key from a given haystack for which the callback > function returns a truthy value [1] or `false` otherwise. The callback > function receives the array item as its only argument [2]. > > Tjerk, This feels alot like array_filter.. Do we really want to introduce yet another way of doing almost the same? Regards, Robin Speekenbrink