Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:102795 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 44634 invoked from network); 12 Jul 2018 22:12:27 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 12 Jul 2018 22:12:27 -0000 Authentication-Results: pb1.pair.com header.from=cmbecker69@gmx.de; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=cmbecker69@gmx.de; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmx.de designates 212.227.15.18 as permitted sender) X-PHP-List-Original-Sender: cmbecker69@gmx.de X-Host-Fingerprint: 212.227.15.18 mout.gmx.net Received: from [212.227.15.18] ([212.227.15.18:36793] helo=mout.gmx.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id FF/40-39793-B42D74B5 for ; Thu, 12 Jul 2018 18:12:27 -0400 Received: from [192.168.2.102] ([79.222.41.233]) by mail.gmx.com (mrgmx002 [212.227.17.190]) with ESMTPSA (Nemesis) id 0LnPGI-1gHk4n06hS-00hblt; Fri, 13 Jul 2018 00:12:23 +0200 To: =?UTF-8?Q?C=c3=b4me_Chilliet?= , internals@lists.php.net References: <59.92.57182.80D864B5@pb1.pair.com> <15790166.CS6Sbgi3TL@mcmic-probook> Message-ID: Date: Fri, 13 Jul 2018 00:12:26 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <15790166.CS6Sbgi3TL@mcmic-probook> Content-Type: text/plain; charset=utf-8 Content-Language: de-DE Content-Transfer-Encoding: 8bit X-Provags-ID: V03:K1:Pz3HKrltwIMirg9Ixesy9ZOwLearcSwBq2niRzJ6/KPoMcxfo8+ 3WIBMuTS2tRhU13NH5aZjBheYI5QLJUUmR1MWCnCxDocFCfUlU4/6jQQ83t3FkEOkmbxWCs 3S749/R9n8We5nqpuNtgxPcPi1rRuJBXfPZZEv0z0xGX8Tm/9RLciz7u/kmgFXGp2ab1ry1 Uf8Zh0RnT+gft5WSWO0lw== X-UI-Out-Filterresults: notjunk:1;V01:K0:dbR9JrBiuls=:fbxBfDAD6nB2vL2JtzJL1R 3Oc8zVCq7PFiZJuWt1FOrWF+rnY3fmZ4WP2Ofym7hXkkv3uQVVt6QuKWXY0UTHJgOD+4TvX+5 OPIG1OqaHhahKWRL7wPeF9OlD0HS6nJnfqak5Ib3RxDglApbUMz9pNVUlKJ3Uqck4HfnDa+hC yh3XwNbp6zFtRDLmKwq1z0zbTrd3U+vB82Kze2d4wV0treHL9stM2cmxSMJwWKJd38QXMOgPi da3UaPfXkfUSh1TlEy30SsLA2PHLls2HdpAcQ/RVsH4RmiJSSrw5kMy35kQUn3PbNL7fGIVfi wm+jdbGZUNRury5+E38/LGTIjvz1BDh+5cVp0MJ4aCmfBo3mIzV+Ud65/YbhUbd/d2RN+F1zn 5sHYdAlxZSvWec3JRa85P8nWUcSSktaMf5eXI3QpnzdkYCVybxAVUnH0EVjI3OnC6B1cUNjLD yTgJMop3xoHOLwjD5K9rDMq9rcFr9eqfvOt7RpvwJzXAzBgutIFymBuchrvF6VVuhMTBITfZ7 gkJTB3UaecIqeyKeu5QYd8tCClVMnI4NFzRZnYUIv/g2DkQIwykVP2mhTG6QW2jXqb54ATVGv kYWt1Eefdf0Mcmrz8GngH8HrO98VtZoKjI/7V0s4o0reZpcbxOHuZt6oNEAO9AjKI0Eya4+Zn EGTioqZkdWw4DaUvIt3H48SeLc4T23X3jJP9Q3mnRcJLGGjDs6WcrVX+UO4F958PNpNH7xmTP EhrmESXqc8xzrO0IERYxuOni5HYXY/cEL1FzGXSvZncZVhSws9hUVvdXDeh1aSV7R3SC0HPJL Fln0ZRG Subject: Re: [PHP-DEV] [VOTE] array_key_first(), array_key_last(), array_value_first(),array_value_last() From: cmbecker69@gmx.de ("Christoph M. Becker") On 12.07.2018 at 09:06, Côme Chilliet wrote: > Le jeudi 12 juillet 2018, 01:04:36 CEST Andrea Faulds a écrit : > >> Hmm. Returning null with no warning makes perfect sense for keys, since >> null is not a valid key so there's no ambiguity, but for values it seems >> problematic. On that ground I've decided to change my vote to No for the >> value functions, but keep the vote for Yes for the key functions. >> Someone who wants such behaviour could always do >> ($array[array_key_last($array)] ?? null), I guess. Ditto! > You cannot do that easily if the array is returned by a function. > function()[array_key_last(function())] would call the function twice. You can easily store the function's return value in a variable, though. -- Christoph M. Becker