Re: [RFC] Binary String Comparison
| From: | Andrea Faulds | Date: | Thu, 21 Aug 2014 20:58:31 +0000 |
| Subject: | Re: [RFC] Binary String Comparison | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-76784@lists.php.net to get a copy of this message | ||
On 17 Aug 2014, at 20:58, Marc Bennewitz <php@mabe.berlin> 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/