Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:105080 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 32483 invoked from network); 4 Apr 2019 19:20:01 -0000 Received: from unknown (HELO mail-lj1-f182.google.com) (209.85.208.182) by pb1.pair.com with SMTP; 4 Apr 2019 19:20:01 -0000 Received: by mail-lj1-f182.google.com with SMTP id f23so2653730ljc.0 for ; Thu, 04 Apr 2019 09:15:42 -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=h63mrE0ooIQcbsxeJMWQUlm769ZGcAM3muWzxBQGYi4=; b=Syqts9BUpZ3W7bGyknopgAl4rnj/Dw0llaS2zJCOVA5Cs2FtZFrDSNYmBuqL+0d4Gs qgqMXbwnatY/aXqgKYOBGzij+O0IhsF0qZr8bI7ZNBZ66q4gLfaowt8juNTDhnBLR+Rr lqyP7cAGNIDQahxG9UpQz9pUv6OeR7mjCdy+iBceoe9Qbg8SJadUoQpnOZEmcX93U6fX tmJlMtj/98H4U2yK3GL1LCUXQwkXpuZVxvLAFeGE4+Q+JopK7WyY+8JqbAkqYG7imB8s ynJDPKc7cHhiTLhW70/OLo8Om1GB0W2GyW9XoidAhH2RtTfTk8+qFzU2sHWzX4dKFN3R UI+A== 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=h63mrE0ooIQcbsxeJMWQUlm769ZGcAM3muWzxBQGYi4=; b=ERf6Ud+duOk5BcR2C5y0UzcRxya/dP8eC20UnGq4zjS5todZAcTjA2kPW8WcLhIulm IJGyQ2U50lAZEoec7qNd6uoU6sdx+/mhoj9oUZ/D9nrExGASK8pffAbpNt5duAGjB7B9 kAeVrEXT/BxEQNi/FnMDHJFLjDozOknE+AN4yjrA3q/vO2iIpsiauUJ5fMnEnwOp+Szx YvFB8lhlCFw6CX05zwjx+8xPyzXabW4TjLXpZ4fUMrY3E1LWsPBIF1Vti77NST82wynt dJfoC0Cr4cmP/75X3f0+I1AwDa86NiRPPE2nxZMbO7+6SjBpeWSoLHdAlxx+iS7KGvLc VO/w== X-Gm-Message-State: APjAAAV9WGq29e7I1Tz7WoRO4fKj1xifAKQlqUuEjqKh/bC2h3QvoYNX BBdyIkUxGp3aZoHm0KgKSupthgA+MP3BeVg+EA4= X-Google-Smtp-Source: APXvYqy4A6uXh8ZqQiFXKr9eDua4txeNJ/F4fY5xW2WDbmxDsuEjMOMqrUU2s6vpIwRgL4QBD0YVoRfxV1ftitZ4+Cc= X-Received: by 2002:a2e:9d99:: with SMTP id c25mr3929097ljj.159.1554394541413; Thu, 04 Apr 2019 09:15:41 -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 09:15:30 -0700 Message-ID: To: Benjamin Morel Cc: Andrea Faulds , PHP Internals Content-Type: multipart/alternative; boundary="0000000000007b5a540585b6ae28" Subject: Re: [PHP-DEV] [RFC] Permit trailing whitespace in numeric strings From: mo.mu.wss@gmail.com ("M. W. Moe") --0000000000007b5a540585b6ae28 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hello, Yes and No php has an existing echo-system of extensions which could not work without this ini model; therefor it's fashion trend which is in my opinion unrealistic or you are ready to break existing infrastructures. Enforcing the right behavior (third one) will break existing code big time; hence at some point you need to go with a transitional state; it does not say that one day you'r not gonna retire it and finally enforcing only one ((the right behavior (third one))). On Thu, Apr 4, 2019 at 9:06 AM Benjamin Morel wrote: > 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 f= or > 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, bu= t >>> 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 >>> this. >>> > From >>> > > initial testing it has surprisingly little impact, but one of the f= ew >>> > 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 wh= itespace 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 whitespac= e >>> > 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 >>> > >>> > >>> >> --0000000000007b5a540585b6ae28--