Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:76615 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 57332 invoked from network); 17 Aug 2014 20:47:19 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 Aug 2014 20:47:19 -0000 Authentication-Results: pb1.pair.com header.from=rasmus@lerdorf.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=rasmus@lerdorf.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain lerdorf.com from 209.85.192.178 cause and error) X-PHP-List-Original-Sender: rasmus@lerdorf.com X-Host-Fingerprint: 209.85.192.178 mail-pd0-f178.google.com Received: from [209.85.192.178] ([209.85.192.178:58678] helo=mail-pd0-f178.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 58/E3-28428-5D411F35 for ; Sun, 17 Aug 2014 16:47:18 -0400 Received: by mail-pd0-f178.google.com with SMTP id w10so6280784pde.9 for ; Sun, 17 Aug 2014 13:47:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type; bh=d41bnQFmYDVZunhvWOqxJSo4/P2AUlFmsy8qvdb97TU=; b=L7d9pZVhfSCr8amSEXQluAp6d2YWpUKJqXbeMngV00kPLVurxhy+Of7fz8qQ7NiIhP gBMsrDglR1Q8QJUYfVQ293M6Vxu4NNjvtGHjZKjFepiGpiQ3TCIAG2andINM1RutFXSQ NjU/w1oapBy7rW168NCCWY60hmv3HANKU4lA/wIad3lizhDCxTFEjKcJYT2jBlbX7j2F y54OGKN27KC1tSfXW/7wbKErNtVrGnYsQSp/Ye3Zqm7zCmpJUN1BIYvi10Jdb8IXZ1Mt 1DaflYVK3EYUp0kmCiQQgAccbnfKZTItLYBUt5Th44Ay2kU5T/i3msFUF1eA/DlyUnnN nJhQ== X-Gm-Message-State: ALoCoQlloSPyIjr6Qye8ZGrf5SowgV56/ks92YA7XsJXUOVF/Pik0DLHcjGzqDUNhGOKjIwDyH3m X-Received: by 10.70.34.73 with SMTP id x9mr35303127pdi.27.1408308434670; Sun, 17 Aug 2014 13:47:14 -0700 (PDT) Received: from [192.168.200.30] (c-50-131-44-225.hsd1.ca.comcast.net. [50.131.44.225]) by mx.google.com with ESMTPSA id dx7sm35967366pab.5.2014.08.17.13.47.13 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 17 Aug 2014 13:47:13 -0700 (PDT) Message-ID: <53F114D0.2070305@lerdorf.com> Date: Sun, 17 Aug 2014 13:47:12 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: Sara Golemon , Marc Bennewitz CC: PHP internals References: <53F1094B.4040100@mabe.berlin> In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="WITigAO2uhC1656eoFp9Ln0MPgVwrHNso" Subject: Re: [PHP-DEV] [RFC] Binary String Comparison From: rasmus@lerdorf.com (Rasmus Lerdorf) --WITigAO2uhC1656eoFp9Ln0MPgVwrHNso Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 8/17/14, 1:18 PM, Sara Golemon wrote: > On Sun, Aug 17, 2014 at 12:58 PM, Marc Bennewitz wrot= e: >> I've created a draft RFC and patch to change the behavior of non-stric= t >> string to string comparison to be binary safe (as the strict compariso= n >> 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". >=20 > What exactly is wrong with =3D=3D=3D, 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 --WITigAO2uhC1656eoFp9Ln0MPgVwrHNso Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.22 (Darwin) Comment: GPGTools - https://gpgtools.org iEYEARECAAYFAlPxFNAACgkQlxayKTuqOuDhqgCgig6aHQe+PYGMxnSMLhpEf/kr gSIAnis2bHalQRWRerLiBPjlFZ+NoC+L =pWpS -----END PGP SIGNATURE----- --WITigAO2uhC1656eoFp9Ln0MPgVwrHNso--