Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:76718 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 70089 invoked from network); 20 Aug 2014 08:56:34 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 20 Aug 2014 08:56:34 -0000 Authentication-Results: pb1.pair.com smtp.mail=php@mabe.berlin; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=php@mabe.berlin; sender-id=unknown Received-SPF: error (pb1.pair.com: domain mabe.berlin from 80.237.132.171 cause and error) X-PHP-List-Original-Sender: php@mabe.berlin X-Host-Fingerprint: 80.237.132.171 wp164.webpack.hosteurope.de Received: from [80.237.132.171] ([80.237.132.171:49490] helo=wp164.webpack.hosteurope.de) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id A0/10-03084-EB264F35 for ; Wed, 20 Aug 2014 04:56:32 -0400 Received: from dslc-082-082-189-238.pools.arcor-ip.net ([82.82.189.238] helo=[192.168.178.27]); authenticated by wp164.webpack.hosteurope.de running ExIM with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) id 1XK1gw-0002Lq-K8; Wed, 20 Aug 2014 10:56:26 +0200 Message-ID: <53F46290.5080203@mabe.berlin> Date: Wed, 20 Aug 2014 10:55:44 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: Pierre Joye CC: Sara Golemon , PHP internals References: <53F1094B.4040100@mabe.berlin> <53F1F534.50109@mabe.berlin> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-bounce-key: webpack.hosteurope.de;php@mabe.berlin;1408524992;f46ee09f; Subject: Re: [PHP-DEV] [RFC] Binary String Comparison From: php@mabe.berlin (Marc Bennewitz) On 18.08.2014 14:53, Pierre Joye wrote: > hi, > > On Mon, Aug 18, 2014 at 2:44 PM, Marc Bennewitz wrote: >> >> >> On 17.08.2014 22:18, Sara Golemon wrote: >>> >>> On Sun, Aug 17, 2014 at 12:58 PM, Marc Bennewitz 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..? >> >> >> The question isn't "What's wrong with ===, strcmp()?" but "What's wrong with >> ==, <, >?". > > And the answer is: not strict and why === exists. Non-strict comparison should do conversion to make both operands comparable. It should not convert both operands into a third unrelated type that wasn't mentioned. Btw. The RFC doesn't handle == and === the same because == *do* type-juggling but only if both operands are not on the same type. strcmp() isn't the same behavior as it first converts both operands into a string. > > Cheers, >