Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:105068 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 11246 invoked from network); 4 Apr 2019 12:02:08 -0000 Received: from unknown (HELO mail-io1-f41.google.com) (209.85.166.41) by pb1.pair.com with SMTP; 4 Apr 2019 12:02:08 -0000 Received: by mail-io1-f41.google.com with SMTP id d201so1327574iof.7 for ; Thu, 04 Apr 2019 01:57:45 -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=Wl2PaFGXiw+hurfw9ww2xXd40GuBCPUFt0gXu8dZcrQ=; b=LmsmpQlUuqWh4dxBdwtRgOkvDvdcMjcYCQafsCEVpZJmX4Aoi7MbbTUIp3EL/LwOtl Wpkk6pLdCIhYCyfUrhKVUliSFvfL6XbPLuplo1TKg4DlRDX+TDVyITuLC5FS+M6WX3v+ iKGosN2hshDwrQz1fDkZfO7jMjILF59LLWmdlXQ3LT3SwxYh4P2sMRwR8seOjVqbR+Vh Q34tAU/5l7I+pd6ChjNvcGfgodtu6LYs4qw/Vc30/bqW3LuGkK3I0unPmS8OqXgf6sLl SCZeX2Hy7hRJgHtLYROx/9TfJI0ZW/kO95yJPB8dbgam3Qzw9zEcPV4xyv4ggAA34RRC 0cBQ== 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=Wl2PaFGXiw+hurfw9ww2xXd40GuBCPUFt0gXu8dZcrQ=; b=bgREEBChxRL6TDjSjCak30bPXO22d9dNtFYuzoa8xX2BM8LFkIF6+O9WF92z1pW6t9 FgO+KiPpDKEAdh1CfeYiK1JhbF28DOYvxgAmNZNCKgF+Ep+xF0PQUDCE0+bHUi9scDHO hqsiL9rAzlzTKSXxk7qKi24HazES2tekz0mOLGxVRUgeyZ3gApUt05+3Ogp1EraaPN/Z 9/BjG+DW5O2HztGGKNoCn2hxjGlEeU0gxoTtKIQKPgN20P5ZyiykKoi61fv90kks4gz9 8DmDFOujP+PHQIb5cZ+zCl/lcllvex5x5qSNASMa0oYw3CrufLZdt0Cm0NCVrFltUe3+ r1ig== X-Gm-Message-State: APjAAAXVLDyde1S28W7ShmD7CARwWrQjuGu2cKsvmRWomIhSanizgiHO DquMVc4i7uE2zy6BkqCohP1YirG16MMIfNoLExra3Q== X-Google-Smtp-Source: APXvYqxkfQpYz4DWA/PHGlxn8d9iO5uzRFMVRYcdeY9lwpyb4coTL6UYN3r8mPSW6gnJgrHlinf2+1CesfSb3ZtjMFo= X-Received: by 2002:a6b:e706:: with SMTP id b6mr3476265ioh.78.1554368264637; Thu, 04 Apr 2019 01:57:44 -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: <5ca53ea8.1c69fb81.d773b.1df3SMTPIN_ADDED_MISSING@mx.google.com> Date: Thu, 4 Apr 2019 10:57:31 +0200 Message-ID: To: Andrea Faulds Cc: PHP Internals Content-Type: multipart/alternative; boundary="0000000000004393a20585b09001" Subject: Re: [PHP-DEV] [RFC] Permit trailing whitespace in numeric strings From: benjamin.morel@gmail.com (Benjamin Morel) --0000000000004393a20585b09001 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 stri= ng > > definition more permissive and is thus mostly backwards compatible. Doi= ng > > the reverse change is certainly not compatible and will be a much harde= r > > 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), w= e > > can make *other* things more strict, because this essentially eliminate= s > > 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 othe= r > > 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 this. > From > > initial testing it has surprisingly little impact, but one of the few > 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 than a > > stricter numeric string definition without leading/trailing whitespace. > > I'm kinda unsure how to go forward because of these points. I would like > 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 whites= pace 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 > > --0000000000004393a20585b09001--