Newsgroups: php.internals
Path: news.php.net
Xref: news.php.net php.internals:102760
Return-Path: <come@opensides.be>
Mailing-List: contact internals-help@lists.php.net; run by ezmlm
Delivered-To: mailing list internals@lists.php.net
Received: (qmail 32974 invoked from network); 11 Jul 2018 15:33:00 -0000
Received: from unknown (HELO lists.php.net) (127.0.0.1)
  by localhost with SMTP; 11 Jul 2018 15:33:00 -0000
Authentication-Results: pb1.pair.com smtp.mail=come@opensides.be; spf=pass; sender-id=pass
Authentication-Results: pb1.pair.com header.from=come@opensides.be; 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 lists.fusiondirectory.org  
Received: from [195.154.20.141] ([195.154.20.141:45960] helo=smtp.opensides.be)
	by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP
	id 12/38-15421-B23264B5 for <internals@lists.php.net>; Wed, 11 Jul 2018 11:33:00 -0400
Received: from localhost (localhost [127.0.0.1])
	by smtp.opensides.be (Postfix) with ESMTP id B1202BC180
	for <internals@lists.php.net>; Wed, 11 Jul 2018 17:32:56 +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 TLDsSmv1pvuB for <internals@lists.php.net>;
	Wed, 11 Jul 2018 17:32:30 +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 ECCBABC137
	for <internals@lists.php.net>; Wed, 11 Jul 2018 17:32:29 +0200 (CEST)
To: internals <internals@lists.php.net>
Date: Wed, 11 Jul 2018 17:32:13 +0200
Message-ID: <2460703.pXiu2L5z5n@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: <CAFMT4Nr+jLDyJuDsadjEqj3qM6XCZsVUNZ+PhjgfEW_r_WmOrQ@mail.gmail.com>
References: <e8fdd7ca-135a-2a7f-79cd-e45486f4ba8b@web.de> <15027216.5udLFCpNTc@mcmic-probook> <CAFMT4Nr+jLDyJuDsadjEqj3qM6XCZsVUNZ+PhjgfEW_r_WmOrQ@mail.gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset="iso-8859-1"
Subject: Re: [PHP-DEV] 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 mercredi 11 juillet 2018, 07:37:56 CEST Levi Morrison a =E9crit :
> This is true. For completeness the fix is very mild:
>=20
>     if (([$_, $value] =3D array_first(some_function()) && $value > 3) {
>         // do something
>     }
>=20
> I still think this is better. Forcing you to handle the error case is
> not a bad thing.

The point of these functions is to avoid complicated hard to read code for =
simple operations.
This if is hard to read for me and not much better that array_values(some_f=
unction())[0].

C=F4me