Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:54234 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 92758 invoked from network); 28 Jul 2011 18:15:08 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 28 Jul 2011 18:15:08 -0000 Authentication-Results: pb1.pair.com header.from=keisial@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=keisial@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.54 as permitted sender) X-PHP-List-Original-Sender: keisial@gmail.com X-Host-Fingerprint: 74.125.82.54 mail-ww0-f54.google.com Received: from [74.125.82.54] ([74.125.82.54:64034] helo=mail-ww0-f54.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id A3/88-35879-A27A13E4 for ; Thu, 28 Jul 2011 14:15:07 -0400 Received: by wwf4 with SMTP id 4so2737284wwf.11 for ; Thu, 28 Jul 2011 11:15:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type; bh=ocwN42JEhAgIgd6/Ty5fL8MlfFB6y29PovzOGoj3lfw=; b=HOcJUuNZYedSfguVZUoG2KE1DoQAZ4+6Ty3buFbtR+FephVc1MUYD9i07uQ5KmHNGN Ve7kPvy+fqJW0x8nk9pQXPHUsSZmYtqhpw25ubEFTrPDQFCo4INdYoMl67Nj1IzOANwk o+/pDP/npG0LD4mRc/ZK8q44SBmPCg8jgPkMQ= Received: by 10.227.13.77 with SMTP id b13mr430038wba.54.1311876903979; Thu, 28 Jul 2011 11:15:03 -0700 (PDT) Received: from [192.168.1.26] (121.Red-83-52-184.dynamicIP.rima-tde.net [83.52.184.121]) by mx.google.com with ESMTPS id gg16sm1066516wbb.0.2011.07.28.11.15.01 (version=SSLv3 cipher=OTHER); Thu, 28 Jul 2011 11:15:02 -0700 (PDT) Message-ID: <4E31A872.5030608@gmail.com> Date: Thu, 28 Jul 2011 20:20:34 +0200 User-Agent: Thunderbird MIME-Version: 1.0 To: Laruence CC: PHP Internals References: In-Reply-To: Content-Type: multipart/alternative; boundary="------------000601030105070003020103" Subject: Re: [PHP-DEV] [RFC]strn(case)cmp supporting negative length as third parameter From: keisial@gmail.com ("=?UTF-8?B?w4FuZ2VsIEdvbnrDoWxleg==?=") --------------000601030105070003020103 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Laruence wrote: > Hi: > > strn(case)cmp dosen't support a negative length as its third > paramter, while substr dose. > here is the rfc: https://wiki.php.net/rfc/strncmpnegativelen > > any question? plz worte me back. > > thanks What do you exactly mean by "in the reverse order" in > if the abs of the negative length is greater than any strlen of the > first two parameters, then strn(case)cmp will work as strncmp in the > reverse order with the abs value: Looking at > var_dump (strncmp ("prefix_num", "num", -10)); > //outpu: int(7) it seems to mean that it would be equivalent to > var_dump(strncmp("mun_xiferp", "mun", 10)); However, if I'm reading the patch correctly, it would be taking the smaller string. Ie. it would be equivalent to > var_dump (strncmp ("prefix_num", "num", -3)); Seems an implementation bug. --------------000601030105070003020103--