Re: [PHP-DEV] [VOTE] Saner string to number comparison

2020-07-17 Thread Nikita Popov
On Fri, Jul 17, 2020 at 6:29 PM Benjamin Morel 
wrote:

> Thanks for this RFC, Nikita! This is definitely a step in the right
> direction, and I can only hope it will pass.
>
> One question:
>
> > (...) by using a number comparison only if the string is actually
> numeric. *Otherwise the number is converted into a string, and a string
> comparison is performed.*
>
> Is there a reason to perform another comparison as a string, when the
> string is not numeric? I can’t think of a case where the string comparison
> would match.
>

Comparisons are not just about equality, they are also about ordering.

Nikita


Re: [PHP-DEV] [VOTE] Saner string to number comparison

2020-07-17 Thread Benjamin Morel
Thanks for this RFC, Nikita! This is definitely a step in the right direction, 
and I can only hope it will pass.

One question:

> (...) by using a number comparison only if the string is actually numeric. 
> Otherwise the number is converted into a string, and a string comparison is 
> performed.

Is there a reason to perform another comparison as a string, when the string is 
not numeric? I can’t think of a case where the string comparison would match.

- Benjamin