Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:121352 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 27067 invoked from network); 17 Oct 2023 16:06:44 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 17 Oct 2023 16:06:44 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 4C9FD1804B0 for ; Tue, 17 Oct 2023 09:06:43 -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.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS29838 64.147.123.0/24 X-Spam-Virus: No X-Envelope-From: Received: from wout1-smtp.messagingengine.com (wout1-smtp.messagingengine.com [64.147.123.24]) (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 ; Tue, 17 Oct 2023 09:06:42 -0700 (PDT) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id 690713200A55; Tue, 17 Oct 2023 12:06:41 -0400 (EDT) Received: from imap43 ([10.202.2.93]) by compute5.internal (MEProxy); Tue, 17 Oct 2023 12:06:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mjec.net; h=cc :cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm3; t=1697558800; x=1697645200; bh=oK HPWrGsbyHkeufeRfIZ9EKaKs1z5TwAPaFjD9i04kU=; b=uu3/7yZ2POZQaQd1wt kG8rxcaEyPnCYbPfHqF4U462FnK+epmdJK1dwFhO7EkFLpqP8RWUgcyuxFaWzzvC ezJxceM1CmaIIrxtLcOP14CcbD4XLV8wwv1Q8Y/xfHiVot/NjJOKhuj6KnNMazmy TRYxUeZavmApLwHHfaTa0Y78YmTUINJFtuNtRTFbfkAQPumSIhRQlwWeAj32cDji CsewSQBjS8pF2w4JVFyjM8uo3nCkGezAlx+taynR2tRj+ljtz+pVRLIZIQYp3YHm FPy7FKRA7vWNrEqbJh9tY82D3hH0GQOsQ42YbA+xoc8uDXNp2ZoGkbMBT52aq8j8 DcSA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; t=1697558800; x=1697645200; bh=oKHPWrGsbyHke ufeRfIZ9EKaKs1z5TwAPaFjD9i04kU=; b=VqIh6F5FbeVFdDJcjUSQd9KA04/9+ 2S2aXms/is6hNUWmvNCyy8jucBu8Qxo6DRezOOoVYt1o6DsHxjt53cFq/VODaigu 0kqb4yhpnRfQR96ZsZKB1QXROQwusaVlHYGtXUDcluwSspUIBWxJH8/1cC1JOm+X FsOXaTlk8R+3gLw4xhduYx6YNuBMySxXV+DIrZBY/taqpS6UxzchVqnGvTw/PAmg AL0qAQFuAxnl+y6CqwGDYdftaZSAhMoLsOEzDApk+kzoYC6s1OhLqZNSYbFJBX1Z ymW1K7Ad3jbAlWYL2kv7YAxOhssIjilXJJBeExz/UBx4oXo7S5VTti/Pg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrjedvgdelgecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefofgggkfgjfhffhffvvefutgesthdtredtreertdenucfhrhhomhepfdfoihgt hhgrvghlucevohhrughovhgvrhdfuceophhhphesmhhjvggtrdhnvghtqeenucggtffrrg htthgvrhhnpeejtefhhfefkefgffegueefteettddtkeffledtvdetveevkefhgeefvdeh ffevudenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe hphhhpsehmjhgvtgdrnhgvth X-ME-Proxy: Feedback-ID: iea414789:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 52F0F2D40087; Tue, 17 Oct 2023 12:06:40 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.9.0-alpha0-1019-ged83ad8595-fm-20231002.001-ged83ad85 MIME-Version: 1.0 Message-ID: <0e05d40c-8574-4fd1-9d73-d6434fc6a2c3@betaapp.fastmail.com> In-Reply-To: References: Date: Tue, 17 Oct 2023 12:06:08 -0400 To: "Levi Morrison" , "David Grudl" Cc: "Levi Morrison via internals" Content-Type: text/plain Subject: Re: [PHP-DEV] Two new functions array_first() and array_last() From: php@mjec.net ("Michael Cordover") On Tue, Oct 17, 2023, at 05:10, Levi Morrison via internals wrote: > It's true that sentiment may have shifted in this time. However, a > common argument at that time still stands: `null` is not a good > sentintenal for failure because the value inside the array very well > could have been null. What about a signature like: ```php array_first(array $array, mixed $value_if_missing = null); ``` That would let you specify your own sentinel (or default) where appropriate, without losing the convenience of this function. mjec