Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:104959 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 43094 invoked from network); 26 Mar 2019 23:39:53 -0000 Received: from unknown (HELO NAM05-CO1-obe.outbound.protection.outlook.com) (40.92.13.99) by pb1.pair.com with SMTP; 26 Mar 2019 23:39:53 -0000 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:X-MS-Exchange-SenderADCheck; bh=M08P2vd6rKIy8kSxwkPjMPy1lMTzC8GnLKqMdD80Lbk=; b=MRdwY3CipTYCxqT8W7WA/FQCxcLuFyNi5QyKKcxC4ouBdnPLAC9e9iDtLtDCA670f4+m09r+IAJ1hOtxZqoU/vdl9wwrOTJmkX5vJCXmiZMEB4Tdx1J1ngRtldqHhFffA4c+XgvYppr0YHI7mNSaBB7j4cIjNFebxcAqSulgVh4zOMJpx1usnlBI0TXOXibK7PSut3G6t8nUssYwvSiTCnljQWE9RyxxnlLNcl1Py1wHp/q9RaUAO9xxx+zB75ff554a/VeF/Ax4VxF3GsQjmt8U1OeSxBGL5pJFnt11DoVzn8WI9ZzZanAbqf8YGj6KL4M9+amtbi03MlWthllZpQ== Received: from BY2NAM05FT005.eop-nam05.prod.protection.outlook.com (10.152.100.55) by BY2NAM05HT145.eop-nam05.prod.protection.outlook.com (10.152.101.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1750.4; Tue, 26 Mar 2019 20:33:20 +0000 Received: from DM5PR06MB2857.namprd06.prod.outlook.com (10.152.100.59) by BY2NAM05FT005.mail.protection.outlook.com (10.152.100.142) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1750.4 via Frontend Transport; Tue, 26 Mar 2019 20:33:20 +0000 Received: from DM5PR06MB2857.namprd06.prod.outlook.com ([fe80::2580:dff:c36e:ea31]) by DM5PR06MB2857.namprd06.prod.outlook.com ([fe80::2580:dff:c36e:ea31%6]) with mapi id 15.20.1750.014; Tue, 26 Mar 2019 20:33:20 +0000 To: Andrea Faulds , "internals@lists.php.net" Thread-Topic: [PHP-DEV] Re: [RFC] Permit trailing whitespace in numeric strings Thread-Index: AQHU4D58rGPNRAObhkqyBSvir6YeuKYePmHJ Date: Tue, 26 Mar 2019 20:33:19 +0000 Message-ID: References: , In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-incomingtopheadermarker: OriginalChecksum:485121026A00936BB96DFCF8B5391282773047B810977B4A1E64F8B16F3AE3A1;UpperCasedChecksum:571C08DFD59998CAA23AA48CA52E09390142BB1530FC643B22C986B74B1A98E7;SizeAsReceived:6990;Count:44 x-ms-exchange-messagesentrepresentingtype: 1 x-tmn: [wtP031TjD+mz9NW7VHIGRifQvStUA0gK] x-ms-publictraffictype: Email x-incomingheadercount: 44 x-eopattributedmessage: 0 x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(20181119110)(201702061078)(5061506573)(5061507331)(1603103135)(2017031320274)(2017031324274)(2017031322404)(2017031323274)(1601125500)(1603101475)(1701031045);SRVR:BY2NAM05HT145; x-ms-traffictypediagnostic: BY2NAM05HT145: x-microsoft-antispam-message-info: ORqqXq+ParNIXHfuszTjltd7M/1McU5StHNRLf/p9+8uSiDz17LZULvoe0wfxeel Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-Network-Message-Id: 6e287878-4768-424b-4bf9-08d6b22a48ed X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-originalarrivaltime: 26 Mar 2019 20:33:19.9894 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Internet X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2NAM05HT145 Subject: Re: [PHP-DEV] Re: [RFC] Permit trailing whitespace in numeric strings From: theodorejb@outlook.com (Theodore Brown) On Thu, March 21, 2019 6:33 PM Andrea Faulds wrote:=0A= =0A= > > On Tue, March 5, 2019 6:16 PM Andrea Faulds wrote:=0A= > > =0A= > > Here's an RFC that's been lying in my drafts for uh=85 26 months:=0A= > > =0A= > > https://wiki.php.net/rfc/trailing_whitespace_numerics=0A= > > =0A= > > I expect this should be an uncontroversial proposal, but maybe I'm=0A= > > jinxing it there. I hope you all like it. :)=0A= > > =0A= > > Thanks to Nikita for reminding me it existed and thus motivating me to= =0A= > > pick it up again. Also thanks to Nikita for suggesting a potential=0A= > > follow-up RFC, and also making the "Saner string to number comparisons"= =0A= > > RFC, both providing additional impetus for me to finally clean this up= =0A= > > and put it to discussion.=0A= >=0A= >=0A= > I would proceed to a vote with this (and do intend to still), but the=0A= > response from internals has been very quiet. Has it gotten lost among=0A= > all the other things happening? :)=0A= > =0A= > I realise it's not a very exciting change of course, and there isn't=0A= > much to discuss about it. It's pretty much a like it or hate it RFC with= =0A= > no particular nuance beyond that.=0A= > =0A= > One thing I do wonder about (given reaction on reddit and my personal=0A= > general doubt) is how internals feels about whether we should take the=0A= > opposite approach, that is, to break backwards-compatibility by=0A= > rejecting *leading* whitespace in numeric strings instead. All the=0A= > arguments in favour of this RFC's approach can also apply to that=0A= > approach if you flip them around. The main reason to go for what I did=0A= > so far is, well, it's harder to justify backwards-compatibility=0A= > breakages. But I also initially came up with this when PHP 8 wasn't on=0A= > the horizon.=0A= =0A= =0A= Hi Andrea, thanks for bringing forward this RFC. As a userland=0A= developer, I definitely support fixing the current inconsistent=0A= behavior one way or another:=0A= =0A= ```php=0A= var_export("50" =3D=3D " 50"); // true=0A= var_export("50" =3D=3D "50 "); // false=0A= ```=0A= =0A= The current RFC removes the inconsistency by making both cases true.=0A= This is better than nothing, but I think it would be better yet to=0A= make both cases false. *Either way would be a BC break*, but from my=0A= perspective it doesn't make sense to auto-trim whitespace when=0A= comparing a string with another string.=0A= =0A= Thanks,=0A= -Theodore=