Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:109844 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 50728 invoked from network); 25 Apr 2020 12:34:56 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 25 Apr 2020 12:34:56 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 650C51804C2 for ; Sat, 25 Apr 2020 04:07:20 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS8075 40.64.0.0/10 X-Spam-Virus: No X-Envelope-From: Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-oln040092065104.outbound.protection.outlook.com [40.92.65.104]) (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 ; Sat, 25 Apr 2020 04:07:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gU31b2AkmLGtxA2moDBnpmz7imIe2aac3lcmtaKz10Z9rhIEtFaaHx/cZsLeUrR/KaJ4xo2q28OCFiX3OKv2Useyi9SbOFjULSeomY/2T368KIqJiBymREnSGvpATyochgrDIchsnC8Bi5Mg6KoARYg4id+9xFRKrdLXxFYeaBhWRjGBUMr0kvlj+gbKvCPal3CW46JPlLsMSgXEKLTpH1ZrEtfjy71fle1+rBAZFFvKCnGuo5FeN8JUxnaJDfoN1pN3F6sDa/1jLNwbw9yU0HqleoQDABaql5dRmuB0saS6BwH6lP18e7Wqg+l+BkK7SUxf38M2FACFhuPFMKQs4g== 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=uvOiItK0TbILyUIwGD0x+CsKtHLl+MXy6zJGkEglveo=; b=EU9yBV9Qq4mgQT0/KaNJQ8bSR1wNaVT1YLZJYkfRq9SXndOajnB+BtDxD9+IJIpK9ds3Zul63FDqs7a+SF2dUY3b2lQja0yreQU4phueMCKiffFgbuT9T/nbnO+V4tTBYPf2q66RuBgJSZd0acQgNq1Q3bBiI4Tfeqz7PYfJ9A5wJjgBUcQvXQX8yLeSKRMWLbPvWpI1vGE8jxl9suerTTHUvxniB3mLTmcj7xsROJGEzUQdf0jMLXlvkvMSBVGh1wHXI3uwJFDYiNb8MI1Jb6FeTawD5+JSD9T0B86CRhwk7tI/Jg5JV4xoZdYw62cCGHAp7B4HnFgIKSu2+3HHqw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=hotmail.com; dmarc=pass action=none header.from=hotmail.com; dkim=pass header.d=hotmail.com; 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=uvOiItK0TbILyUIwGD0x+CsKtHLl+MXy6zJGkEglveo=; b=PtoFNHUupTvZhqusf+ck0B7Ff2Dik1NFckeotXjThq+z2QHU81HKVRkXZSuM6UTXv9XD2c0IN7DRPbg0Q9MxCsCDeRF8cGvwJKJyCRxaeJyRLRAkg+n2pDsSJSc/9iYTMG7QYonSz/TT9zy+6/lNJoQDjqBl9d/geAT7WqMjFDyL0aDdGtkkEC3YZq1RyCmBA0ubzvUQgm8NApNY+tijaRSNxVGqE6Zbq9vT66US75NxNspFvZAfn1WSGL2htqQVWz5UY+tcDKswTeYZG11kwfxghf8eZ9Hnt+1YsGXfQNlPrfMLMDp3W8JLeelhf8Qj3VFww2kr14AowRM1qJKLxA== Received: from DB5EUR01FT041.eop-EUR01.prod.protection.outlook.com (2a01:111:e400:7e1a::4d) by DB5EUR01HT082.eop-EUR01.prod.protection.outlook.com (2a01:111:e400:7e1a::437) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.15; Sat, 25 Apr 2020 11:07:17 +0000 Received: from VI1PR02MB4703.eurprd02.prod.outlook.com (2a01:111:e400:7e1a::52) by DB5EUR01FT041.mail.protection.outlook.com (2a01:111:e400:7e1a::447) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.15 via Frontend Transport; Sat, 25 Apr 2020 11:07:17 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:C489FB4D8BFAB9ED164F06B7D9C0F722763AF091AC90331E25A621E171205A9A;UpperCasedChecksum:04FFD777A4C80FA0E61BF075D1C85A9CC53E14251F5DF56672A4BE9B65C3E159;SizeAsReceived:7783;Count:50 Received: from VI1PR02MB4703.eurprd02.prod.outlook.com ([fe80::61d8:9f5e:4baf:492d]) by VI1PR02MB4703.eurprd02.prod.outlook.com ([fe80::61d8:9f5e:4baf:492d%7]) with mapi id 15.20.2937.012; Sat, 25 Apr 2020 11:07:17 +0000 Content-Type: text/plain; charset=us-ascii In-Reply-To: Date: Sat, 25 Apr 2020 13:07:11 +0200 Cc: PHP internals Content-Transfer-Encoding: quoted-printable Message-ID: References: To: Ilija Tovilo X-Mailer: Apple Mail (2.3445.104.11) X-ClientProxiedBy: PR3P191CA0060.EURP191.PROD.OUTLOOK.COM (2603:10a6:102:55::35) To VI1PR02MB4703.eurprd02.prod.outlook.com (2603:10a6:803:8f::13) X-Microsoft-Original-Message-ID: <08105589-8780-426C-A254-1B2F30B5B8CC@hotmail.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from [IPv6:2001:7e8:cba2:c100:1d9:c36:bbf3:36a6] (2001:7e8:cba2:c100:1d9:c36:bbf3:36a6) by PR3P191CA0060.EURP191.PROD.OUTLOOK.COM (2603:10a6:102:55::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.13 via Frontend Transport; Sat, 25 Apr 2020 11:07:16 +0000 X-Mailer: Apple Mail (2.3445.104.11) X-Microsoft-Original-Message-ID: <08105589-8780-426C-A254-1B2F30B5B8CC@hotmail.com> X-TMN: [bSYCr6MriWOiGWnuU63qI8JkpuLNGlJLNVCy9QcLzvUHuuMsLv2UGWo8cSwFUPZs] X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 50 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: a9b2bc46-1e8d-456b-55d1-08d7e908d0a6 X-MS-TrafficTypeDiagnostic: DB5EUR01HT082: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: owktVfrZtU1p5qaszXcqByemaV6sdozXFe09qhx149EskkbKU84mjzxtArsOw63NG6FM2MfzCVOzRf1CNYenmIRZhu+g8hQ0PDLyOT3HOlZi6lQWX6Ov8lAIksv7449c0fHiGef0Tl//L+vW+/lo4IMgoGwAIkNqDcOC8oajspzpEPm8hgdoWH/2m+H+367u6jDl6Q2rc7LAqI659BtnNQwA7UIFHEkITxc6CEwzjEPVSpZIUCIGhDwvnsnFbDtz X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:0;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR02MB4703.eurprd02.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:;DIR:OUT;SFP:1901; X-MS-Exchange-AntiSpam-MessageData: uYT/auFea9jhR0gSO4XCgpuGB7qEGihhc/+peuGUWnoD72mVul9TPr2lxvGSn4oYUslpDU0hvCGftlIKIsBTbqvcTB/1QcW4QLL3v8AWQltVhg5420Q0DC2XWsKwejeBdoB9tp3lMDcCUvwp0eXJTxqGNBtHeiN/Pjb555zVSBLUGfi5wkqrvJJ9kvCuI2KDASm0WgnEuoMc4gp2j700Bw== X-OriginatorOrg: hotmail.com X-MS-Exchange-CrossTenant-Network-Message-Id: a9b2bc46-1e8d-456b-55d1-08d7e908d0a6 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Apr 2020 11:07:17.1163 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-FromEntityHeader: Internet X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB5EUR01HT082 Subject: Re: [PHP-DEV] [VOTE] match expression From: bobwei9@hotmail.com (Bob Weinand) > Am 25.04.2020 um 12:39 schrieb Ilija Tovilo : >=20 > Hi internals >=20 > I have opened the voting on the match expression RFC. It will end on > 9th of May, 2020. > https://wiki.php.net/rfc/match_expression >=20 > Here are the last changes: >=20 > In the last update I mentioned allowing return values in blocks. > Unfortunately, we discovered some technical difficulties (memory > leaks) which are very hard to solve. Nikita is experimenting on a > possible solution. There was also a fair bit of backlash over the > syntax. Thus I have decided to move block expressions to a separate > RFC. Note that blocks with just statements remain part of this RFC. >=20 > The "duplicate condition" warning mentioned by Dan was removed due to > the arguments made by Tyson. >=20 > I have also moved the optional semicolon for the match in statement > form to a separate vote as this was another controversial part of the > proposal. >=20 > Furthermore I have added another secondary vote for allowing to drop > (true) conditions as that was suggested multiple times: >=20 > match { > $age >=3D 30 =3D> {}, > $age >=3D 20 =3D> {}, > $age >=3D 10 =3D> {}, > default =3D> {}, > } >=20 > // Equivalent to >=20 > match (true) { > $age >=3D 30 =3D> {}, > $age >=3D 20 =3D> {}, > $age >=3D 10 =3D> {}, > default =3D> {}, > } >=20 > There is a separate poll for specifying the reason for a "no" vote. > Let me know if there are any other reasons so I can add those to the > poll. >=20 > A personal thank you goes out to Tyson for his guidance! >=20 > Regards, > Ilija Hey Ilija, while in general I'm okay-ish with match using a strict comparison, shall the "match { $cond1 =3D> {}, $cond2 =3D> {} }" syntax be strict or no= t? I would do a simple truthiness check in that particular case (which IMHO= is also consistent as there is no explicit value it's compared against). That way it would essentially have the semantics of a chained ternary witho= ut being illegible. At least as match {} without explicit expected value is effectively a boole= an comparison (doesn't feel really like a strict value comparison), it shou= ld also behave like a classical boolean comparison. In general, apart from that very last change (I think you should have given= it at least 1-2 days of consideration before starting the vote), the RFC i= s nice and provides a concise syntax for something which usually is quite u= glily expressed. Bob=