On 8/17/14, 1:18 PM, Sara Golemon wrote:
> On Sun, Aug 17, 2014 at 12:58 PM, 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
>>
> If I understand your goal correctly, you seem to want to change a very
> fundamental (and ancient) behavior of the language even though
> mechanisms already exist to do what you describe as the "changed
> behavior".
> 
> What exactly is wrong with ===, strcmp(), etc..?

Yes, this would be a very problematic change at this point. It isn't
something you could audit your code for easily and make it future-proof.
Something that used to work will simply not and it will be nearly
impossible to understand why.

I don't necessarily disagree that this is perhaps the way it should have
worked from the beginning, but without an upgrade path I don't think we
can do this. The only mention in your RFC towards this is:

   This can be easily resolved by explicitly casting one of the
   operands to an integer or float respectively define the sorting
   algorithm."

That is not an upgrade path. Going through and auditing every single
comparison in a large code base to see if one side should perhaps be
cast to a different type is not feasible.

-Rasmus

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to