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

[email protected] (Marc Bennewitz)
Newsgroups php.internals
Message-ID <[email protected]>
On 20.08.2014 19:50, Ferenc Kovacs wrote:
> 
> 2014.08.17. 21:59 ezt írta ("Marc Bennewitz" <[email protected]>):
>>
>> Hi internals!
>>
>> 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.
>>
>> As a side effect it makes string comparison much faster and force
> developer to really write what they mean (No need to guess) and to force
> developers to cast/filter input once which also affects performance.
>>
>> On C-Level the function zendi_smart_strcmp will be unused and marked
> as deprecated.
>>
>> Thanks,
>> Marc
>>
>> --
>> PHP Internals - PHP Runtime Development Mailing List
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
> 
> Maybe it was already mentionex, but just to make sure:  this would fix
> issues like https://bugs.php.net/bug.php?id=54547
> 
Yes, such comparison issues will go away!
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.