Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:121320 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 37137 invoked from network); 15 Oct 2023 03:49:13 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 15 Oct 2023 03:49:13 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 2BB831804D0 for ; Sat, 14 Oct 2023 20:49:13 -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=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS9370 160.16.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail.sakiot.com (mail.sakiot.com [160.16.227.216]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Sat, 14 Oct 2023 20:49:12 -0700 (PDT) Received: from smtpclient.apple (softbank060067217005.bbtec.net [60.67.217.5]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by mail.sakiot.com (Postfix) with ESMTPSA id 81264401D4; Sun, 15 Oct 2023 12:49:09 +0900 (JST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=sakiot.com; s=default; t=1697341749; bh=CXvDOlxFTb+2qFQ4IoczuoHy9RoVlI7D8GZiUBkSYTA=; h=From:Subject:Date:References:Cc:In-Reply-To:To:From; b=lYOVGR1dZsMAXb428N18Md0LL2VBzf29Z6O5t3iStXTc14yMlRRds/qKPEA2Gqa5h goQaDry9rK9sl8MCwts4Dj2TLq1yXJfpt7DUTIwFm8kxgo/cuhUkDXnBw3zPuMAIP8 9nIxl+AIIju2CuzZb7s/NO9HD1d7xqJGpMAYQQ38= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (1.0) Date: Sun, 15 Oct 2023 12:48:57 +0900 Message-ID: References: <3006DBD0-411C-4855-A101-9B8861544B61@sakiot.com> Cc: internals@lists.php.net In-Reply-To: <3006DBD0-411C-4855-A101-9B8861544B61@sakiot.com> To: David Grudl X-Mailer: iPhone Mail (20G81) Subject: Re: [PHP-DEV] Two new functions array_first() and array_last() From: saki@sakiot.com (Saki Takamachi) I came up with the idea of =E2=80=8B=E2=80=8Busing a signature like array_fi= lter(), and when a callback is passed, "return the first/last element that m= atches the condition" and "return null if there is no match." The downside to this idea is the loss of simplicity. So I'll leave it up to y= ou whether you want to go with this idea or not. I have no intention of forc= ing this. Best regards. Saki=