Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:102784 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 96610 invoked from network); 12 Jul 2018 07:06:41 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 12 Jul 2018 07:06:41 -0000 Authentication-Results: pb1.pair.com header.from=come@opensides.be; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=come@opensides.be; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain opensides.be designates 195.154.20.141 as permitted sender) X-PHP-List-Original-Sender: come@opensides.be X-Host-Fingerprint: 195.154.20.141 smtp.opensides.be Received: from [195.154.20.141] ([195.154.20.141:57032] helo=smtp.opensides.be) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id AC/B4-57182-DFDF64B5 for ; Thu, 12 Jul 2018 03:06:39 -0400 Received: from localhost (localhost [127.0.0.1]) by smtp.opensides.be (Postfix) with ESMTP id BBEA7BC275 for ; Thu, 12 Jul 2018 09:06:34 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at opensides.be Received: from smtp.opensides.be ([127.0.0.1]) by localhost (smtp.opensides.be [127.0.0.1]) (amavisd-new, port 10024) with LMTP id xW7oR2yPdHeF for ; Thu, 12 Jul 2018 09:06:31 +0200 (CEST) Received: from mcmic-probook.localnet (63.120.199.77.rev.sfr.net [77.199.120.63]) by smtp.opensides.be (Postfix) with ESMTPSA id 8BCB8BBF2B for ; Thu, 12 Jul 2018 09:06:31 +0200 (CEST) To: internals@lists.php.net Date: Thu, 12 Jul 2018 09:06:25 +0200 Message-ID: <15790166.CS6Sbgi3TL@mcmic-probook> Organization: OpenSides User-Agent: KMail/5.2.3 (Linux/4.9.0-6-amd64; KDE/5.28.0; x86_64; ; ) In-Reply-To: <59.92.57182.80D864B5@pb1.pair.com> References: <59.92.57182.80D864B5@pb1.pair.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="iso-8859-1" Subject: Re: [PHP-DEV] [VOTE] array_key_first(), array_key_last(), array_value_first(),array_value_last() From: come@opensides.be (=?ISO-8859-1?Q?C=F4me?= Chilliet) Le jeudi 12 juillet 2018, 01:04:36 CEST Andrea Faulds a =E9crit : > Hmm. Returning null with no warning makes perfect sense for keys, since=20 > null is not a valid key so there's no ambiguity, but for values it seems= =20 > problematic. On that ground I've decided to change my vote to No for the= =20 > value functions, but keep the vote for Yes for the key functions.=20 > Someone who wants such behaviour could always do=20 > ($array[array_key_last($array)] ?? null), I guess. You cannot do that easily if the array is returned by a function. function()[array_key_last(function())] would call the function twice.