Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:54582 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 82875 invoked from network); 14 Aug 2011 14:02:25 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Aug 2011 14:02:25 -0000 Authentication-Results: pb1.pair.com header.from=laruence@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=laruence@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.220.170 as permitted sender) X-PHP-List-Original-Sender: laruence@gmail.com X-Host-Fingerprint: 209.85.220.170 mail-vx0-f170.google.com Received: from [209.85.220.170] ([209.85.220.170:44552] helo=mail-vx0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id A4/45-50938-075D74E4 for ; Sun, 14 Aug 2011 10:02:24 -0400 Received: by vxh24 with SMTP id 24so3756486vxh.29 for ; Sun, 14 Aug 2011 07:02:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=oOMcyLqoSWq5PIukKzCwr/qXdfmxPAYKMPkvMRZtqOk=; b=AD4B+l3P7lw2GQQpM2RS6Uvfq4OAgULNvmU1xgB/0Z0fI2gwpXrzrzcDJdxHQajwC9 PbQ1loNtATZPPKRqoYPsSmo854AEHY2FHVsshkai60QjknT+QxOmw0DTpcFROf31cx0A hV/9PMzViUKHrHHukZOD+/Khl4+7We7VyJ1mM= MIME-Version: 1.0 Received: by 10.220.210.195 with SMTP id gl3mr737035vcb.190.1313330541679; Sun, 14 Aug 2011 07:02:21 -0700 (PDT) Sender: laruence@gmail.com Received: by 10.220.184.76 with HTTP; Sun, 14 Aug 2011 07:02:21 -0700 (PDT) In-Reply-To: References: Date: Sun, 14 Aug 2011 22:02:21 +0800 X-Google-Sender-Auth: vDsPdVQqb6V2AQPzPgy97JOTvjM Message-ID: To: Derick Rethans Cc: Ferenc Kovacs , PHP Internals Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] [VOTE]strn(case)cmp supporting a negative length as its third paramter From: laruence@php.net (Laruence) Hi: I think what I was done is try to describe a image, that we can make follow codes more simple: if (strncmp(substr("num_suffix", 0, -5), "suffix", 5) =3D=3D 0) { echo "they have the same suffix"; } yes, there is must something not good in my patch, but I think I can tweak it as you wish. the only thing I want you to accept is : " should this behavior is more make sense for some occassion?" thanks 2011/8/14 Laruence : > Hi: > =C2=A0 this just to say that stncasecmp has the same behavior of either > negative or postive length argument. > > =C2=A0 why you insist to this point? =C2=A0as strncmp("aaaa", "bbb", =C2= =A01000000) > works with no warning, =C2=A0why negative length need trigger warnings? > > thanks > > 2011/8/14 Derick Rethans : >> On Sun, 14 Aug 2011, Ferenc Kovacs wrote: >> >>> On Sun, Aug 14, 2011 at 1:24 PM, Derick Rethans wrote: >>> > On Sat, 13 Aug 2011, Laruence wrote: >>> > >>> >> Dear all: >>> >> =C2=A0 =C2=A0 I am going to close strn(case)cmp supporting negative = length vote, >>> >> since it has been calling for vote near two weeks, and no new feedba= ck >>> >> . >>> >> >>> >> =C2=A0 =C2=A0 the Voting result is: >>> >> =C2=A0 =C2=A0 =C2=A0Support : =C2=A06 =C2=A0felipe pajoye pierrick g= wynne tyrael laruence >>> >> =C2=A0 =C2=A0 =C2=A0Decline : =C2=A03 =C2=A0iliaa rasmus salathe >>> >> >>> >> =C2=A0 =C2=A0 it wins 2/3 vote, =C2=A0 so I think this supposed to m= ean that accept, =C2=A0right? >>> > >>> > I voted against too. Also, you started the vote with not even a week >>> > between RFC announcement and call for voting, so I guess that makes t= his >>> > invalid? >>> > >>> > >>> > Just looked over the RFC, and this whole example is weird: >>> > >>> > >> > var_dump(strncmp("prefix_num", "num", -10)); >>> > ?> >>> > >>> > Why does it even find the substring as you can't do "-10" from the en= d? >>> > If the number is too high, it should give you a warning. >>> >>> imo the patch is consistent with how substr works: >>> tyrael@thor:~$ php -d display_errors=3D1 -d error_reporting=3D-1 -r 'ec= ho >>> substr("prefix_num", -100);' >>> prefix_num >> >> Maybe, but I would classify *that* as a bug as it makes no sense at all. >> >> Derick >> >> -- >> http://derickrethans.nl | http://xdebug.org >> Like Xdebug? Consider a donation: http://xdebug.org/donate.php >> twitter: @derickr and @xdebug > > > > -- > Laruence =C2=A0Xinchen Hui > http://www.laruence.com/ > --=20 Laruence =C2=A0Xinchen Hui http://www.laruence.com/