Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:100503 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 22055 invoked from network); 10 Sep 2017 16:05:13 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 10 Sep 2017 16:05:13 -0000 Authentication-Results: pb1.pair.com smtp.mail=theodorejb@outlook.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=theodorejb@outlook.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain outlook.com designates 40.92.0.35 as permitted sender) X-PHP-List-Original-Sender: theodorejb@outlook.com X-Host-Fingerprint: 40.92.0.35 mail-oln040092000035.outbound.protection.outlook.com Received: from [40.92.0.35] ([40.92.0.35:36838] helo=NAM01-BN3-obe.outbound.protection.outlook.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 12/DE-10715-6B265B95 for ; Sun, 10 Sep 2017 12:05:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=/EfW1FIhB11XEb1jbcRbJE/j3gql8b73fKngY6nE0KY=; b=NVmNklA5nR2NPXdU8MpkXWAya7TzsnKyzwUkGFoD70dCCBcGsCSFzdN3QQRAXXCk5HJ1rbGF6lUb0ODWp94ZczdDSEBfsDYh6wi2LfXoDkD2fULAOrD5xFsQDxmWgz+/5Nr/OPJ6Zr9qhKhIz9MBk9ndR37ny8fVFs+7le2qz6vfgN+pw06866DjLe/QAaMQZ1w5WZZ2gGRFsaxgzfybUGJcjTyFT5OxKO86g/ky1+S1Z4p1xNM1SyPNOTYOVxyEO64lJ2K4xYcBnh2vdJDVu+wAKu6QqtwS4ZamfsBusS/T3qV3KOMtZyLLw/m4NlmCCN14TxOxiCcEL3JweZtnQQ== Received: from SN1NAM01FT014.eop-nam01.prod.protection.outlook.com (10.152.64.55) by SN1NAM01HT168.eop-nam01.prod.protection.outlook.com (10.152.65.182) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.20.13.11; Sun, 10 Sep 2017 16:05:07 +0000 Received: from DM3PR18MB0764.namprd18.prod.outlook.com (10.152.64.53) by SN1NAM01FT014.mail.protection.outlook.com (10.152.65.155) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.20.13.11 via Frontend Transport; Sun, 10 Sep 2017 16:05:06 +0000 Received: from DM3PR18MB0764.namprd18.prod.outlook.com ([fe80::f9b3:b36b:de38:5d0]) by DM3PR18MB0764.namprd18.prod.outlook.com ([fe80::f9b3:b36b:de38:5d0%14]) with mapi id 15.20.0035.019; Sun, 10 Sep 2017 16:05:06 +0000 To: "ilija.tovilo@me.com" , PHP internals Thread-Topic: [PHP-DEV] [RFC] Match expression Thread-Index: AQHTKV3YFIHcaR2NE0G7f/Tjxy+CuaKuRVEq Date: Sun, 10 Sep 2017 16:05:06 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: me.com; dkim=none (message not signed) header.d=none;me.com; dmarc=none action=none header.from=outlook.com; x-incomingtopheadermarker: OriginalChecksum:628A5653DF8DBADD5B1734B5E44A5015BF89DA946DF255FEECE170EAE388075E;UpperCasedChecksum:42D93E8CDE4644B678FE2669077FD0200380D6B198AE3E108346148CEC74FFB9;SizeAsReceived:7022;Count:46 x-ms-exchange-messagesentrepresentingtype: 1 x-tmn: [Z9FbkY8NAtUABc+ge5LVcMWWRl74v7XT] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;SN1NAM01HT168;6:c+yKMJCVHPTLdOh1u3yhp+NoEAbkivh0B+G1M2wNUKDjurwEXr+fT84cB0SEoETaonvxOyPm96D1rilkIyEPouibeRdD7KIvXuvifXSfGb0lhU9td+c+Hjh6B0iIssfRG8qiFhGIg9BYGSVNOWt8xIuvXRQTy3oFFGKslXaie6KU7dqMuL1J4m7r27/gwerLSojXe1Q/fcoPCe3avzI29RJVgstG2/UuOpaChKfhOrD2RcNnR31mOyOz2I2yfpkSp7TG+i7ug4PEngkm7MK0c2ZQQvDBQYD1BkTSRzxYDxmFssj2cMcpfkYL55pPqQj8LP4hEFsPUX2qvjGn+wJpZQ==;5:GDtimTI94z4/IqyPNZL/jIM3DUsXM8bM8QbSefbtI1p1f4NtiUSHZVMS9uWfX4LHes1jlLfJc/5eIN8q3CvpzEv91+l8xd0FkqMRlRVxLRk86FUNmr2psRuvfjo0KrqY00MElHFlUO5aP7JaUWwHZQ==;24:iWPENZUmw0EXln6sQwfkBYuxK+K205avjMTFBqWog6cN3j84TbUoitx5X/xt43NfXUf2Y7iWYIJ8/RBhjb/9/I0k7mXXk5dvdJq8VfTP400=;7:0Lqu/7WWfYx66lrRsRfPRp97sZGJxIHebV15y7awcxynBWHoZKHpUaJpmTjDtfKW+NnU02bNTmATd06y8JhNTETQ1UhKdgxBK977K2qDWHCgl4Qm9wZGg/OEUk9KupbJJvgQI+UVZnI1ONm2yRQ4lhb7mnpB5X9jgdg1m0arHw+dKXYGLsvJpqW3Qlb4JlZ8QsEUzXA//zFeSoANW5eXYfEd5Aj7WMY1A2Sc3GmzQxw= x-incomingheadercount: 46 x-eopattributedmessage: 0 x-ms-office365-filtering-correlation-id: cfbd0d4e-a7c5-449b-885c-08d4f865b46b x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(300000502095)(300135100095)(22001)(300000503095)(300135400095)(201702061074)(5061506573)(5061507331)(1603103135)(2017031320274)(2017031324274)(2017031323274)(2017031322404)(1603101448)(1601125374)(1701031045)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095);SRVR:SN1NAM01HT168; x-ms-traffictypediagnostic: SN1NAM01HT168: x-exchange-antispam-report-test: UriScan:(188474585043545); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(444000031);SRVR:SN1NAM01HT168;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:SN1NAM01HT168; x-forefront-prvs: 04267075BD x-forefront-antispam-report: SFV:NSPM;SFS:(7070007)(98901004);DIR:OUT;SFP:1901;SCL:1;SRVR:SN1NAM01HT168;H:DM3PR18MB0764.namprd18.prod.outlook.com;FPR:;SPF:None;LANG:; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: multipart/alternative; boundary="_000_DM3PR18MB07647618E0682A20C05C255FDE6B0DM3PR18MB0764namp_" MIME-Version: 1.0 X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-originalarrivaltime: 10 Sep 2017 16:05:06.7007 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Internet X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1NAM01HT168 Subject: Re: [PHP-DEV] [RFC] Match expression From: theodorejb@outlook.com (Theodore Brown) --_000_DM3PR18MB07647618E0682A20C05C255FDE6B0DM3PR18MB0764namp_ Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable On Saturday, September 9, 2017 6:21 AM, ilija.tovilo@me.com wrote: > I find myself writing switch statements in PHP quite rarely. This has a f= ew reasons: > 1. It doesn=92t have a "strict_types=94 version > ... > I assume that some people will not be so happy about having to switch-lik= e constructs. IMO the implicit type conversion is the biggest issue here. M= aybe we could offer a solution for this one at least. I also rarely use switch, primarily because of the lack of strict compariso= n. Personally I would prefer having an option for strict comparison when using= switch, similar to how `in_array` has an optional `$strict` parameter. Would it be possible to add an optional `$strict` parameter to switch? E.g. ``` switch ($i, true) { case 1: echo 'i is 1'; break; case: 1.0: echo 'i is 1.0'; break; case '1': echo 'i is "1"'; break; case true: echo 'i is true'; break; } ``` -Theodore Brown --_000_DM3PR18MB07647618E0682A20C05C255FDE6B0DM3PR18MB0764namp_--