Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:120511 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 14554 invoked from network); 2 Jun 2023 09:01:28 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 2 Jun 2023 09:01:28 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 7166A1804D7 for ; Fri, 2 Jun 2023 02:01:28 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-0.7 required=5.0 tests=BAYES_05,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS8075 104.40.0.0/13 X-Spam-Virus: No X-Envelope-From: Received: from azure.fide.pl (azure.fide.pl [104.45.0.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Fri, 2 Jun 2023 02:01:28 -0700 (PDT) Received: from [192.168.10.21] (178235013211.warszawa.vectranet.pl [178.235.13.211]) by azure.fide.pl (Postfix) with ESMTPSA id 380B7FDAEC for ; Fri, 2 Jun 2023 11:01:27 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=fide.pl; s=mail; t=1685696487; bh=tVr8pOWCblBBQUOVmUg+IFStMUBp3gOoGuZsP0YyG1A=; h=Date:Subject:To:References:From:In-Reply-To:From; b=EZR9VWv7hYTc3/guCSblf8ebQevQcZgplNi+JwYOVvJoN8QXi/tNloJWKsFit0jJ3 rHeeoN2Yl00zeSBLJOXS2P8UT3fyte9OEJJQxNtriLnT7a6dWk1ZP47AC0zqvAFZz8 W71bhMWx65nntvp6S7ZVC51kOhKMNmJBupiwL8HE= Message-ID: <33323bf1-0256-5cd4-69f3-1cd209267747@fide.pl> Date: Fri, 2 Jun 2023 11:01:26 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.11.2 Content-Language: pl To: internals@lists.php.net References: <97308c1d-e9f0-e28d-78ba-11da2a136ee6@fide.pl> <6c66ad82-7616-4b22-8961-494b557a3def@app.fastmail.com> Organization: FIDE.pl In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [PHP-DEV] Proposal: addition of array_find() and array_find_key() functions From: janusz@fide.pl (Janusz Szczypka) W dniu 2.06.2023 o 03:24, Hans Henrik Bergan pisze: > sounds like array_find could be implemented by just adding a new flag > for array_filter's $mode: > ARRAY_FILTER_STOP_ON_FIRST_MATCH > or some such? array_filter is guaranteed to always return an array and we should not change it. Flags are used just to decide what should be sent to a callback. In my other e-mail I have just proposed adding similiar flags to array_find function as you have it now in array_filter, so it can be used to search by keys and/or values. Best regards, Janusz