Re: [VOTE]strn(case)cmp supporting a negative length as its third paramter
| From: | Derick Rethans | Date: | Sun, 14 Aug 2011 13:00:00 +0000 |
| Subject: | Re: [VOTE]strn(case)cmp supporting a negative length as its third paramter | ||
| References: | 1 2 3 4 5 6 7 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-54578@lists.php.net to get a copy of this message | ||
On Sun, 14 Aug 2011, Ferenc Kovacs wrote:
> On Sun, Aug 14, 2011 at 1:24 PM, Derick Rethans <derick@php.net> wrote:
> > On Sat, 13 Aug 2011, Laruence wrote:
> >
> >> Dear all:
> >> 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 feedback
> >> .
> >>
> >> the Voting result is:
> >> Support : 6 felipe pajoye pierrick gwynne tyrael laruence
> >> Decline : 3 iliaa rasmus salathe
> >>
> >> it wins 2/3 vote, so I think this supposed to mean that accept, right?
> >
> > 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:
> >
> > <?php
> > var_dump(strncmp("prefix_num", "num", -10));
> > ?>
> >
> > Why does it even find the substring as you can't do "-10" from the end?
> > 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=1 -d error_reporting=-1 -r 'echo
> 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