Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:113115 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 92067 invoked from network); 8 Feb 2021 18:17:17 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 8 Feb 2021 18:17:17 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id EAA451804E1 for ; Mon, 8 Feb 2021 10:02:03 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=BAYES_20,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from NAM04-BN8-obe.outbound.protection.outlook.com (mail-bn8nam08olkn2050.outbound.protection.outlook.com [40.92.47.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Mon, 8 Feb 2021 10:02:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=g2vF7WrtxMwJPQa/2yK/FInqx27khZAPIas95BB7vAZ1LcwrdLMDwa5psAzMk6WQHK/8e2hPQ24NJhjwXYcgwbnlobpqc1Inll4N5OeiK/3RJjWhpGdvwSRbz954Jdw3He5vLz1GMSANbj/pHLr/iMOejbZOZjEAPy5tD+n6z7e98YgFlgPcMrOJ+mVc9OEszaB7/M9WLp8HwStEQ4xo8du6B199FN3xqXu6nF9+P/C3RbsTW8zmwxpcQd2XG5NKgOHn7fBOxq2Ij5neQZAqqsCf0Gj7X9JXIf7hXpczeYGZ5AFlSMf4htog61pRw7KzNlQosmZWUFSeWHCkA2AKWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=tcWE9Dhf0vuN1lw9ZmRfAK9n/2hMleNt8++6cysb31I=; b=g5PM7kZZxmhU2FVEVCaQWTAIVtwe89AhVlaTuL4zAiLUG7wQY2CNkS8NToUE8bwfxk8ucYA6noLfGHYPvaCsEaazGG4L0ZyY0octGCspEXmOWJxy6tkopw510uLQkqNsyerHhOYRrIzVa2KvqP4EDzv/W0NKWCSoJosq1G6+Hu49XAEOfSfLwWrYxGl7GFcoXs3XM2TKTg6t/wchq5U3ujmwOvAXz8Mlwc1sUKYtYYKFQtUdDh4PqoI2+KVu95ihZ4NlhrrgyLKTdJbXmoUbLd3oDX7NLgyYd9XoMW4pjsJ+faz/4AxExqz3TGdvM8z5L/Jo+Y1qTYOFk4+0SDyjVA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hotmail.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=tcWE9Dhf0vuN1lw9ZmRfAK9n/2hMleNt8++6cysb31I=; b=WItc/W9LIvLYecRlts4n6YtMb/GWk6bJf2bTOzR4v/+gORmuBXTJx5mQvHY67MT7eLcRF+mtjHnHUBuC3p5Wg/DCgJptxkPMUwQ83KA4xLHjvCHgGiqTtQrFql/maHSv7QmEHynvuEj4dI8v1lcuW6XAhkhL3BucqqfC5MNnT35dWQd584/GaX5uddCPDBdB7A7DhNZkZxXLbBnAIBt7QdXVXQxcFFHNHpYBEo9qsoxHoekWLYdqcAJfkQ5caK9pJo70M5sjVtdOL7406u98m9RmgcVbca61/013eUT9c6vsvWpKCfFw3Hj//Q46b7fEg3/D6Cgow5sFyqYjFQL+vw== Received: from SN1NAM04FT003.eop-NAM04.prod.protection.outlook.com (10.152.88.55) by SN1NAM04HT121.eop-NAM04.prod.protection.outlook.com (10.152.89.95) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3784.12; Mon, 8 Feb 2021 18:02:01 +0000 Received: from DM6PR07MB6618.namprd07.prod.outlook.com (2a01:111:e400:7e4c::49) by SN1NAM04FT003.mail.protection.outlook.com (2a01:111:e400:7e4c::174) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3784.12 via Frontend Transport; Mon, 8 Feb 2021 18:02:01 +0000 Received: from DM6PR07MB6618.namprd07.prod.outlook.com ([fe80::b4c4:dc11:5337:821d]) by DM6PR07MB6618.namprd07.prod.outlook.com ([fe80::b4c4:dc11:5337:821d%4]) with mapi id 15.20.3825.030; Mon, 8 Feb 2021 18:02:01 +0000 To: Larry Garfield , PHP internals Thread-Topic: [PHP-DEV] [VOTE] PHP\iterable\any() and all() on iterables Thread-Index: AQHW/ibG3D0K4gIX3kCegHwWEoc5IqpOVSSAgAA2OhM= Date: Mon, 8 Feb 2021 18:02:01 +0000 Message-ID: References: ,<77dfe9e5-a6d1-4a41-bceb-454a65cf34d0@www.fastmail.com> In-Reply-To: <77dfe9e5-a6d1-4a41-bceb-454a65cf34d0@www.fastmail.com> Accept-Language: en-CA, en-US Content-Language: en-CA X-MS-Has-Attach: X-MS-TNEF-Correlator: x-incomingtopheadermarker: OriginalChecksum:7623C6DD5BECD37D9875D9714F356601EB55199233297D75E0D8B46D8C0A4ACE;UpperCasedChecksum:78B1E19949687497EB9205244B26EA3DBB764927C7F9A3B73CBD0D4C2378AE27;SizeAsReceived:6999;Count:44 x-ms-exchange-messagesentrepresentingtype: 1 x-tmn: [A5HFFUZ5kkXHZKMFUGr19rIVwNSQpafW] x-ms-publictraffictype: Email x-incomingheadercount: 44 x-eopattributedmessage: 0 x-ms-office365-filtering-correlation-id: 9c3deff9-e65c-41da-c3bd-08d8cc5ba261 x-ms-traffictypediagnostic: SN1NAM04HT121: x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: f5LNQZsk7bwOPtLdqtqjry3CJ/VK7S8m/BUi2sue9FlWP1Ool9Ej/kcf5m+B/zxUVZXUWFQpvKEz6Rp0TadYKVtAkGQbvkRaxAF5qoWeSJBfgXuhJVFIywYWli/Zpbtww55EwU5UAu9z1lSM8Rsea67ESadzPAuxa7kFI8CwFeqmzz+dARxenauXNbpgQmS5MrALz/8QdsL49cyESiJe/PqByAZx7HakElMAu2vFlrS3Sp/VkGYtqCh1ir55iaLf25rhvJ1242dR9gNg5/F9OQVOQ/WG/ZPo2oPVBBvhoWP0u1IPHVYpUO1gdq4gABIfvHJ+6Mv2JXnP5e774+wJ3AXc6OH/G3d+2XBxuo0X6lsdgLel1hvE27jfQTXZx76FqgDIhumW+R+T+0iSnClXHTbj/0NAWKSgBA0pP5S/4oj/y6zmXf9kHMNp8+jU/f+Y x-ms-exchange-antispam-messagedata: qXIDgEO9RtIvsVM184jCregCOxEM3ZNyGneVLPMqMjFRYdqzD2SIxdGBDtyBcKb8MuFzdghDRX0b9X0xbl2AqMnlAN5kVoaPFz+0Dkjj7vX+XLQzuagy9yNqZ0wzCuWfsEURDl6JddG7YRFgxg5Kmw== x-ms-exchange-transport-forked: True Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: hotmail.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-AuthSource: SN1NAM04FT003.eop-NAM04.prod.protection.outlook.com X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-Network-Message-Id: 9c3deff9-e65c-41da-c3bd-08d8cc5ba261 X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Feb 2021 18:02:01.0721 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Internet X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1NAM04HT121 Subject: Re: [PHP-DEV] [VOTE] PHP\iterable\any() and all() on iterables From: tysonandre775@hotmail.com (tyson andre) Hi Larry Garfield,=0A= =0A= > > Hi internals,=0A= > > =0A= > > Voting has started on https://wiki.php.net/rfc/any_all_on_iterable and = =0A= > > ends on 2021-02-22.=0A= > > =0A= > > This RFC proposes to add the functions `PHP\iterable\any(iterable =0A= > > $input, ?callable $callback =3D null): bool` and `PHP\iterable\all(...)= `=0A= > > to PHP's standard library's function set, using the namespace preferred= =0A= > > in the previous straw poll.=0A= > > =0A= > > There is a primary vote on whether to add the functions, and a =0A= > > secondary vote on the name to use within the `PHP\iterable` namespace.= =0A= > > =0A= > > Thanks,=0A= > > - Tyson=0A= > > --=0A= > > PHP Internals - PHP Runtime Development Mailing List=0A= > > To unsubscribe, visit: https://www.php.net/unsub.php=0A= > =0A= > =0A= > Ak!=A0 I literally just finished reading it and wanted to note a lack of = clarity on one point. :-)=0A= > =0A= > The signature of the callback is never specified explicitly.=A0 The terna= ry is a bit confusing.=A0 I assume the signature is =0A= > =0A= > callable(mixed): bool=0A= > =0A= > But that's not made explicit.=A0 It's also not made explict that omitting= the callable collapses to "is truthy".=A0 That's a sensible thing to do, b= ut it's not stated explicitly anywhere, just inferred from the code sample.= =0A= > =0A= > I'm not sure if it's safe to clarify at this point as the vote just start= ed.=0A= =0A= If there is a callable, it allows `callable(mixed): mixed`,=0A= and converts the callable's return value to a boolean.=0A= So omitting the callable is the same as passing in the callable `fn($x) =3D= > $x`, which is equivalent to `fn($x) =3D> (bool)$x`.=0A= This is exactly what the reference implementation would do.=0A= =0A= I definitely should have clarified it instead of assuming that the referenc= e implementation was clear enough.=0A= =0A= I clarified this and gave examples because the RFC started a few hours ago = and the implementation didn't change.=0A= =0A= - Tyson=0A=