Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:54585 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 90364 invoked from network); 14 Aug 2011 14:52:56 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Aug 2011 14:52:56 -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:48624] helo=mail-vx0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C1/B6-50938-541E74E4 for ; Sun, 14 Aug 2011 10:52:54 -0400 Received: by vxh24 with SMTP id 24so3772056vxh.29 for ; Sun, 14 Aug 2011 07:52:51 -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=fSjNqCzZOUnBwcGV5cwDKtc+jkfIDW0v4MRhIuoQxoU=; b=lFqFrrN15SGbRcQVYby1uzqrvbwyaKR+5kJc2nlGJUgID8r7fRsZmNVKP0FdE5eKTb pFA4oZnvUeFmN0jah67/kxuKrgckku9r0Lva7wvNLdvrVdFQmrnHvvy+Oc75JlN/V6UV JIwlRTVy6YGBymtmv7y2WN+UwT6jQuXZMuwEk= MIME-Version: 1.0 Received: by 10.220.94.72 with SMTP id y8mr745518vcm.155.1313333571259; Sun, 14 Aug 2011 07:52:51 -0700 (PDT) Sender: laruence@gmail.com Received: by 10.220.184.76 with HTTP; Sun, 14 Aug 2011 07:52:51 -0700 (PDT) In-Reply-To: References: Date: Sun, 14 Aug 2011 22:52:51 +0800 X-Google-Sender-Auth: CY15Gh6mkEKtTOLi1hfo0uMcAPE Message-ID: To: Derick Rethans Cc: Ferenc Kovacs , PHP Internals , Pierre Joye , Felipe Pena 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 all internalers: Since there comes some new objections, I think I should open the RFC voteing again. to Derick, if I extended voting phase for two weeks , can we consider this voteing valid? I think this proposal is not explained clearly before, so I am going to explain it agian, and I am not good at english, so if I make you confused, sorry in adva= nce. ------- this RFC comes from a Featurn request: https://bugs.php.net/bug.php?id= =3D36944 when I saw the request, I totally agree with the reporter, and I think this feature can make sense for simplify following situation: : > Hi: > =C2=A0I think what I was done is try to describe a image, that we can mak= e > follow codes more simple: > > =C2=A0if (strncmp(substr("num_suffix", 0, -5), "suffix", 5) =3D=3D 0) { > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0echo "they have the same suffix"; > =C2=A0} > > =C2=A0yes, =C2=A0there is must something not good in my patch, =C2=A0but = I think I > can tweak it as you wish. > > =C2=A0the 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 feedb= ack >>>> >> . >>>> >> >>>> >> =C2=A0 =C2=A0 the Voting result is: >>>> >> =C2=A0 =C2=A0 =C2=A0Support : =C2=A06 =C2=A0felipe pajoye pierrick = gwynne 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 = mean 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 = this >>>> > 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 e= nd? >>>> > 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 'e= cho >>>> 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/ >> > > > > -- > Laruence =C2=A0Xinchen Hui > http://www.laruence.com/ > --=20 Laruence =C2=A0Xinchen Hui http://www.laruence.com/