Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:76639 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 26592 invoked from network); 18 Aug 2014 09:58:38 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 18 Aug 2014 09:58:38 -0000 Authentication-Results: pb1.pair.com smtp.mail=julienpauli@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=julienpauli@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.220.179 as permitted sender) X-PHP-List-Original-Sender: julienpauli@gmail.com X-Host-Fingerprint: 209.85.220.179 mail-vc0-f179.google.com Received: from [209.85.220.179] ([209.85.220.179:42747] helo=mail-vc0-f179.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 4F/95-29636-C4EC1F35 for ; Mon, 18 Aug 2014 05:58:37 -0400 Received: by mail-vc0-f179.google.com with SMTP id hq11so5377648vcb.24 for ; Mon, 18 Aug 2014 02:58:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=sqzlh8UyyEEadq7ZAU2pifgJoxZz41t+kb6GFrMS5bE=; b=UGeHCqHmZLI3lFRoodQEsu81J09WufhA1h3QhgTrVDAkmVD8Zp1R7EDKgIW9/9IBxT Vq9xLOz08Dp/tYQUvOLBwXErTtEUy99GVkOHcjU7hnhay8TxDLwKV92YrM5woqFgWZ0X 8t9+na6hYaayVZT1779YWM84lBEPkojN5FWpk2wyzLFJBqsB0a3cXoU/e0+iEf6jbiBF XwF5wEBPQHDDcx2wkBz5/Q6aIAdeqwp9/faEtVysj58XARNq6LkUYRFzd9nsDKp1eclg QldAXueM3FF2Ks8oZO3vGjmD8lkjprfBiosbXUqNUYgV0ZyzQq/OmTuacx4xztCaGgjE kMwg== X-Received: by 10.220.44.80 with SMTP id z16mr24307447vce.7.1408355913732; Mon, 18 Aug 2014 02:58:33 -0700 (PDT) MIME-Version: 1.0 Sender: julienpauli@gmail.com Received: by 10.220.30.70 with HTTP; Mon, 18 Aug 2014 02:57:53 -0700 (PDT) In-Reply-To: <53F1094B.4040100@mabe.berlin> References: <53F1094B.4040100@mabe.berlin> Date: Mon, 18 Aug 2014 11:57:53 +0200 X-Google-Sender-Auth: naxHZ077oMJk-KNhxOQXAidgrSM Message-ID: To: Marc Bennewitz Cc: PHP internals Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] [RFC] Binary String Comparison From: jpauli@php.net (Julien Pauli) On Sun, Aug 17, 2014 at 9:58 PM, Marc Bennewitz wrote: > 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 This seems to me as a major breakage, not necessary, as strict comparison (===) or strcmp() are available. Julien Pauli