On Thu, March 21, 2019 6:33 PM Andrea Faulds <a...@ajf.me> wrote:

> > On Tue, March 5, 2019 6:16 PM Andrea Faulds <a...@ajf.me> wrote:
> > 
> > Here's an RFC that's been lying in my drafts for uh… 26 months:
> > 
> > https://wiki.php.net/rfc/trailing_whitespace_numerics
> > 
> > I expect this should be an uncontroversial proposal, but maybe I'm
> > jinxing it there. I hope you all like it. :)
> > 
> > Thanks to Nikita for reminding me it existed and thus motivating me to
> > pick it up again. Also thanks to Nikita for suggesting a potential
> > follow-up RFC, and also making the "Saner string to number comparisons"
> > RFC, both providing additional impetus for me to finally clean this up
> > and put it to discussion.
>
>
> I would proceed to a vote with this (and do intend to still), but the
> response from internals has been very quiet. Has it gotten lost among
> all the other things happening? :)
> 
> I realise it's not a very exciting change of course, and there isn't
> much to discuss about it. It's pretty much a like it or hate it RFC with
> no particular nuance beyond that.
> 
> One thing I do wonder about (given reaction on reddit and my personal
> general doubt) is how internals feels about whether we should take the
> opposite approach, that is, to break backwards-compatibility by
> rejecting *leading* whitespace in numeric strings instead. All the
> arguments in favour of this RFC's approach can also apply to that
> approach if you flip them around. The main reason to go for what I did
> so far is, well, it's harder to justify backwards-compatibility
> breakages. But I also initially came up with this when PHP 8 wasn't on
> the horizon.


Hi Andrea, thanks for bringing forward this RFC. As a userland
developer, I definitely support fixing the current inconsistent
behavior one way or another:

```php
var_export("50" == " 50"); // true
var_export("50" == "50 "); // false
```

The current RFC removes the inconsistency by making both cases true.
This is better than nothing, but I think it would be better yet to
make both cases false. *Either way would be a BC break*, but from my
perspective it doesn't make sense to auto-trim whitespace when
comparing a string with another string.

Thanks,
-Theodore
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to