Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:104359 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 38308 invoked from network); 12 Feb 2019 13:47:07 -0000 Received: from unknown (HELO smtp.opensides.be) (195.154.20.141) by pb1.pair.com with SMTP; 12 Feb 2019 13:47:07 -0000 Received: from localhost (localhost [127.0.0.1]) by smtp.opensides.be (Postfix) with ESMTP id 3A2AC268746 for ; Tue, 12 Feb 2019 11:29:58 +0100 (CET) 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 YUw3ZV3vI2lj for ; Tue, 12 Feb 2019 11:29:55 +0100 (CET) Received: from mcmic-probook.opensides.be (63.120.199.77.rev.sfr.net [77.199.120.63]) by smtp.opensides.be (Postfix) with ESMTPSA id 9B24D268716 for ; Tue, 12 Feb 2019 11:29:55 +0100 (CET) To: internals@lists.php.net Date: Tue, 12 Feb 2019 11:29:54 +0100 Message-ID: <2660878.MMxYkSA4mt@mcmic-probook> Organization: OpenSides User-Agent: KMail/5.2.3 (Linux/4.9.0-8-amd64; KDE/5.28.0; x86_64; ; ) In-Reply-To: References: <5437a651-8263-49e9-b87e-d8d052d66c99@web.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="UTF-8" Subject: Re: [PHP-DEV] Variadic is_*() functions From: come@opensides.be (=?ISO-8859-1?Q?C=F4me?= Chilliet) Le lundi 11 f=C3=A9vrier 2019, 08:59:17 CET Levi Morrison a =C3=A9crit : > My position is the same: pushing the variadic behavior into the > functions means that each function needs to pick `||` or `&&` > behavior, both of which are useful. I would rather see more > descriptive function names, such as `all_of` or `any_of`: >=20 > if (!all_of('is_numeric', [$input['example1'], > $input['example2']])) {/*...*/} My first thought was that this must already exists under another name, but = it seems that none of array_map, array_walk or array_reduce allows to do th= at easily. (That is, in a more readable way than the boolean operator string, otherwis= e it=E2=80=99s useless) C=C3=B4me