Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:105077 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 27175 invoked from network); 4 Apr 2019 19:10:46 -0000 Received: from unknown (HELO mail-it1-f172.google.com) (209.85.166.172) by pb1.pair.com with SMTP; 4 Apr 2019 19:10:46 -0000 Received: by mail-it1-f172.google.com with SMTP id 139so4549664ita.4 for ; Thu, 04 Apr 2019 09:06:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=fGWAdX3TLewWm8q59HaaO8VqOAC3CcM7AVRgMOynUfQ=; b=YTwfJoXqn202cif3vI42tM2268m/zuW/pRKIAc28DLgjiCdyV+kDuDCJQ7wN5H8YR5 9NcHHF8zRdNzKcYjWtZoZ6ZHMcXSCQCdBEdB3mXUgxFdNFTzjYQ4T4Q9cD5lUWgeBKD+ Aa5urk4f7PZvg4fSbZWvd8kqvYXv9JCsvofnX89Y2MiHOK8fSLrc/V7WG7p/+kSn6UmC acKo795fk0Hs7eRBPfdtolgeZie8daPJDf7BcgCGGbtlv2SKlNaDxV+Ol/8l1F11rMhW o7cj/DscyZ8DX81mvibleqb+vNj2uJ+6ZZMM4smlTNG9unvaQyoXHEPyZiW2XWuj8yf+ 54qA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=fGWAdX3TLewWm8q59HaaO8VqOAC3CcM7AVRgMOynUfQ=; b=S7vP6INyhaYuak7JQCc327TtnyawY4b4oB4JIzTb/qNjFwTOAxPdtLHO4O1XPlW353 dOlRJ/SNlkfMJZgPKGa1t22eZzQ1sKB7hn+aGsU8VEE55m0KFItEPy0v81/56UovFXu1 KW9Y1DfikZxINq4k7mTOYWH5SQy4MD3onbi9UvlWc11rlbnaqdsfGeomdUZW3G8XYnlH L8ojGRTBK9aWO7fEa3Oimvn5I3F/5wyla6OBHC1TAmB9GqLJjyHs7UdscAnDYmOxbpZd /n9/OBkryVzz2bWrgehKIGohhv6D1lao9S/RuOX6Ftxzla3+G6Te3cnF364ewSPK9SCO FoSQ== X-Gm-Message-State: APjAAAU088xzuT5V/NL1IlUfaJxR6djgit9/wNhiScKjm5v9JF5aXhbi psU1C1knPc86XxDjV304kebHrtjU7j6izHrhLck= X-Google-Smtp-Source: APXvYqwhEPcctFP46sifV951ZiQnp5Il7fyB/fZeMrRrmB6KGjJlg4VjiLyZ6uEde8lZvuOs5DV7z1DjkFTmRDBL5m4= X-Received: by 2002:a02:c007:: with SMTP id y7mr5696056jai.1.1554393986933; Thu, 04 Apr 2019 09:06:26 -0700 (PDT) MIME-Version: 1.0 References: <40683e93-f8e9-5a8c-9646-31c73c99396f@fischer.name> <5ca53ea8.1c69fb81.d773b.1df3SMTPIN_ADDED_MISSING@mx.google.com> In-Reply-To: Date: Thu, 4 Apr 2019 18:06:16 +0200 Message-ID: To: "M. W. Moe" Cc: Andrea Faulds , PHP Internals Content-Type: multipart/alternative; boundary="0000000000006ea8010585b68d6e" Subject: Re: [PHP-DEV] [RFC] Permit trailing whitespace in numeric strings From: benjamin.morel@gmail.com (Benjamin Morel) --0000000000006ea8010585b68d6e Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable > > what about exposing a strict keyword option or a php ini option? There is a trend right now towards avoiding the language to be dependent on php.ini options. I'm on board with this, and would personally strongly discourage introducing such an option, and enforce one of these options for everyone instead. On Thu, 4 Apr 2019 at 17:05, M. W. Moe wrote: > Hello, > > what about exposing a strict keyword option or a php ini option? > > - NO - leave as it is default > - YES - allow trailing whitespace punks > - YES - disallow leading whitespace sane people > > On Thu, Apr 4, 2019 at 1:57 AM Benjamin Morel > wrote: > >> What about going forward with the trailing whitespace RFC right now, but >> ask to vote between 3 options? >> >> - NO - leave as it is >> - YES - allow trailing whitespace >> - YES - disallow leading whitespace >> >> And then proceeding with the string to number comparison RFC? >> >> Ben >> >> On Thu, 4 Apr 2019 at 01:15, Andrea Faulds wrote: >> >> > Nikita Popov wrote: >> > > I'm always a fan of making things stricter, but think that in this >> > > particular case there are some additional considerations we should >> keep >> > in >> > > mind. >> > > >> > > 1. What is more important to me here than strictness is consistency. >> > Either >> > > both " 123" and "123 " are numeric, or neither are. Making "123 >> " >> > > numeric is a change we can easily do, because it makes the numeric >> string >> > > definition more permissive and is thus mostly backwards compatible. >> Doing >> > > the reverse change is certainly not compatible and will be a much >> harder >> > > sell. >> > > >> > > 2. I believe that a large part of the motivation here is that by >> making >> > the >> > > numeric string definition slightly more lax (in a consistent manner)= , >> we >> > > can make *other* things more strict, because this essentially >> eliminates >> > > the only "somewhat reasonable" case of trailing characters. The RFC >> > already >> > > mentions two of them: >> > > >> > > a) We can hard reject "123foo" inputs to "int" arguments (and some >> other >> > > places). Currently this is allowed with a notice. I think if we >> resolve >> > the >> > > trailing whitespace question, then there cannot be any reasonable >> > > opposition to this change. >> > > b) My own RFC on number to string comparisons would benefit from thi= s. >> > From >> > > initial testing it has surprisingly little impact, but one of the fe= w >> > cases >> > > that turned up was this comparison with a string that had trailing >> > > whitespace. >> > > >> > > Personally I think both of those changes are a lot more valuable tha= n >> a >> > > stricter numeric string definition without leading/trailing >> whitespace. >> > >> > I'm kinda unsure how to go forward because of these points. I would li= ke >> > to see improved comparisons, and I would like to see the end of the >> > =E2=80=9Cnon-well-formed=E2=80=9D numeric string, and I think this whi= tespace RFC could >> > be helpful to both. But I can't see the future, I don't know whether >> > people will vote for removing leading or permitting traiing whitespace >> > and whether or not they will be influenced by or this will influence >> > opinion on the further improvements. =C2=AF\_(=E3=83=84)_/=C2=AF >> > >> > I'm torn between: >> > >> > * Vote on allowing trailing whitespace >> > * Vote on disallowing leading whitespace >> > * Vote on which of those two approaches to go for >> > * Trying to bundle everything together and voting on it as a package. >> > >> > I'm probably thinking too strategically. >> > >> > Andrea >> > >> > -- >> > PHP Internals - PHP Runtime Development Mailing List >> > To unsubscribe, visit: http://www.php.net/unsub.php >> > >> > >> > --0000000000006ea8010585b68d6e--