Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:76611 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 49819 invoked from network); 17 Aug 2014 19:58:49 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 Aug 2014 19:58:49 -0000 Authentication-Results: pb1.pair.com header.from=php@mabe.berlin; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=php@mabe.berlin; spf=permerror; 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:43689] helo=wp164.webpack.hosteurope.de) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id FD/72-28428-67901F35 for ; Sun, 17 Aug 2014 15:58:48 -0400 Received: from dslb-178-005-088-134.178.005.pools.vodafone-ip.de ([178.5.88.134] 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 1XJ6bD-0003tP-4x; Sun, 17 Aug 2014 21:58:43 +0200 Message-ID: <53F1094B.4040100@mabe.berlin> Date: Sun, 17 Aug 2014 21:58:03 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: PHP internals Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-bounce-key: webpack.hosteurope.de;php@mabe.berlin;1408305528;d0803386; Subject: [RFC] Binary String Comparison From: php@mabe.berlin (Marc Bennewitz) 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