Re: [PHP-DEV] [RFC] Binary String Comparison

[email protected] (Andrea Faulds)
Newsgroups php.internals
Message-ID <[email protected]>
On 17 Aug 2014, at 20:58, Marc Bennewitz <[email protected]> wrote:

> 
> I've created a draft RFC and patch to change the behavior of non-strict string to string comparison to be binary safe (as the strict comparison operator does):
> 
>     https://wiki.php.net/rfc/binary_string_comparison
> 
> On comparing two numeric strings both operands will be equal if the string representation will be the same. On comparing two numeric strings the first operand will be greater if the first not matching byte will be higher. On comparing two numeric strings the first operand will be lower if the first not matching byte will be lower.

I might as well point out that I am also not in favour of this. In PHP, we *usually* do the Perl-like thing and pretend ints, floats and numeric strings are the same. This RFC reduces the extent to which we do that, meaning PHP would be less consistent. For that reason, I cannot support it.

--
Andrea Faulds
http://ajf.me/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.