Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:109596 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 63124 invoked from network); 12 Apr 2020 15:49:01 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 12 Apr 2020 15:49:01 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 0D7291804CC for ; Sun, 12 Apr 2020 07:18:12 -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=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE, 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-oln040092065090.outbound.protection.outlook.com [40.92.65.90]) (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 ; Sun, 12 Apr 2020 07:18:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VQYbB9fX13FBRdsZqkQ4/16khHEOr+qgsJG3ON3V6KJ/+kX7wV48b4WbR5J3N6sSvEaeWAOEfr+azhHMjDi23L9go8S9vhPWx0CuR9rlII3g8kGX3KuI9ClkT+t/wXiB1seC23G6sIPwXHSa0Rv8SWYT7GKsuv8VajuG8mN55F1eP7hcLmRJxP9GYpCL3dMw4l/YWeVM3K5S4nVsVXbyv/7dG6Lw7+hKWUZ4M4/1E8rqZhkTV/jnqD7/mzs3HaipyemEF4I7KYgelZGrj0zDvUOjppHSaYx5VJKbYrpDxNeovnCXT4Ew7J0MwDqklS+rt+ETGl7G0C6gTJZqekTltQ== 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=LC5KYYsc1YTymfzwR7Y+JwMlnWint40z696+Sh11LEs=; b=CWCSx1ggIi2NOg5FFD7QUsCJwMRqB178QQLuFs694S00hYzKpgXQCk0K56NlsCROyFLriyTcyfs90SOfIeIUqu8Kr1HOmdK1cR59Dl41b7hGJI1PnOALUNSeq1Aoz1UHJ7+QpbuIPjyxC84knYmVNbl5ph0nRVN3cufcSxodzWJqY/ZpbRCqrUJD32Gf+x1AdDUvCXOP9zVucqSl/nAMuHj3MDxaJQD/gE1Eesp6Y8yTRy2p5BT8mmC1ay1e4dwBPpGuZXZ+a57WZVMr47XSZjRAKv+wypq/YUj9Uf0CeDI5Y7Ecthnb6DiFoU6+L1kxVjclLpUCMnJDJ5ffc1PuVQ== 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=LC5KYYsc1YTymfzwR7Y+JwMlnWint40z696+Sh11LEs=; b=VYB9nu/3JQU4bXQeNRKEwpQASjY5MAyMSepz37B2pu7YE6KcehM96O6Tx2XGO/1cBlWMw9OtivUzgeylyFL/Hnyw4hOeO5jK6bNEoYNBnv3ePZqXCLXOsd4bCa769IgCbMMkCNq3bwWnX/lw2HjphM4m7bYDkjMMMp69kUfRp7YOSo6dZNkS5Z4qpGywnKJfy0L2pQkhsjMMVyQoNITsgFYgGS6Z5PLjUTF5Pjm24xhLZmW6csRIpt+FQZbuCNcipU3YqV+Nh0tJVtEsO9maKRrr6RYYtAigcfcChRf71C4oN5T9IMU3wn1wG2KeOT8YtZ4q+WBYf6ZtDSQNXkoOEg== Received: from HE1EUR01FT060.eop-EUR01.prod.protection.outlook.com (2a01:111:e400:7e18::40) by HE1EUR01HT046.eop-EUR01.prod.protection.outlook.com (2a01:111:e400:7e18::324) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2900.15; Sun, 12 Apr 2020 14:18:08 +0000 Received: from VI1PR08MB2813.eurprd08.prod.outlook.com (2a01:111:e400:7e18::4a) by HE1EUR01FT060.mail.protection.outlook.com (2a01:111:e400:7e18::249) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2900.15 via Frontend Transport; Sun, 12 Apr 2020 14:18:08 +0000 Received: from VI1PR08MB2813.eurprd08.prod.outlook.com ([fe80::406a:6628:1bf0:4d24]) by VI1PR08MB2813.eurprd08.prod.outlook.com ([fe80::406a:6628:1bf0:4d24%7]) with mapi id 15.20.2900.026; Sun, 12 Apr 2020 14:18:08 +0000 To: Ilija Tovilo , php internals Thread-Topic: [PHP-DEV] [DISCUSSION] Match expression Thread-Index: AQHWEF+nZG5U35iOAE6gUQQi9rmkvqh1PESGgAA0H4CAABU2uw== Date: Sun, 12 Apr 2020 14:18:08 +0000 Message-ID: References: , In-Reply-To: Accept-Language: es-ES, en-US Content-Language: es-ES X-MS-Has-Attach: X-MS-TNEF-Correlator: x-incomingtopheadermarker: OriginalChecksum:63CC90E22E777D6F5DC33DCEC499B051909020BFF8644C9A216DFE40B96ADC3B;UpperCasedChecksum:E74FE9909C66E9BC26DD2281053E209694B3A195885F567F786983EAF2686B0C;SizeAsReceived:7128;Count:45 x-ms-exchange-messagesentrepresentingtype: 1 x-tmn: [2GLxlZyl7GojNaC4V4qNi/aCtsv1CGzD] x-ms-publictraffictype: Email x-incomingheadercount: 45 x-eopattributedmessage: 0 x-ms-office365-filtering-correlation-id: f1f6af5e-4590-4829-6b06-08d7deec52e6 x-ms-traffictypediagnostic: HE1EUR01HT046: x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: Ht+hB/So1cK2yQ+/+DPilPKVXQlLvULT0sIyb8h5y8pvlvgsUkJp6FNdKHi6dsIdwjQbwJWsyqhPehbh4NcPwXiso3fr2fvQvJLSbDk58/uni4D2NLkqpXR9GYARJIyLG403f3vUHBXkNQKcTGIoWPAThEf3r9HUTlfi73xP7T8eLgTWMVd1GmmwLtwF86jzKyHEWklDiW1vuTuYs3MYDrHCEfWonr2jxDyOGU+di4Q= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:0;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR08MB2813.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:;DIR:OUT;SFP:1901; x-ms-exchange-antispam-messagedata: KeUD3KWcILIZOTFkx9NpqF+cVd8MnvWmI7UMFNOPnUMXd0BawEQPUJlRY0l8m0JYLf8nOhDflYeJrgOyiHiuQVrp91/cUKL3cJ4UxM6vUapPDa5HL/r5gHx7cKG+85sUe+aSMqfRFZOQ1Qg2ShtsmA== x-ms-exchange-transport-forked: True Content-Type: multipart/alternative; boundary="_000_VI1PR08MB2813283C5F26DB5432904A15B8DC0VI1PR08MB2813eurp_" MIME-Version: 1.0 X-OriginatorOrg: hotmail.com X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-Network-Message-Id: f1f6af5e-4590-4829-6b06-08d7deec52e6 X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Apr 2020 14:18:08.0295 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Internet X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1EUR01HT046 Subject: RE: [PHP-DEV] [DISCUSSION] Match expression From: txigreman@hotmail.com (=?Windows-1252?Q?Iv=E1n_Arias?=) --_000_VI1PR08MB2813283C5F26DB5432904A15B8DC0VI1PR08MB2813eurp_ Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable >> Would be posible for blocks to require a return statement instead of rai= sing an error? > >It would be possible for the blocks to return values (though not with >the return keyword). I've created a small prototype a few weeks ago: > >``` >$result =3D match ($x) { > 0 =3D> { > echo 'Foo'; > echo 'Bar'; > 'Baz' > }, > ... >}; >``` > >https://github.com/php/php-src/compare/master...iluuu1994:block-expression >Heavily inspired by Rust: >https://doc.rust-lang.org/reference/expressions/block-expr.html > >While this would perfectly solve the problem perfectly it feels a >little foreign in PHP. Either way, this is something that can be >discussed an implemented in a separate RFC. My only concern about blocks is that I fell a bit odd that they can only be= used under some circustances. I think I would prefer to simply do not include th= em for now, and discuss these =93block expressions=94 in another RFC as they s= eem to be an independent language feature. Regards, Iv=E1n Arias. --_000_VI1PR08MB2813283C5F26DB5432904A15B8DC0VI1PR08MB2813eurp_--