Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:54230 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 2226 invoked from network); 28 Jul 2011 11:32:51 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 28 Jul 2011 11:32:51 -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:50269] helo=mail-vx0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id CF/89-50004-0E8413E4 for ; Thu, 28 Jul 2011 07:32:49 -0400 Received: by vxi39 with SMTP id 39so2045729vxi.29 for ; Thu, 28 Jul 2011 04:32:46 -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=la7ERiGTZo6RKn1cEiCHkjO27FFRmajhdnfsjEvN8p8=; b=kud/7DjL/2RxwdB8bVc4JhX5xtVR+fQQuZnq9SuOSrJJG0LEzl8S34Akfa6jO8myZN /vkbBRq/adfpxzkfR27TL2iVD7ziz0Hn5eJLx5+zUGXo1um3EUFyT42Rh20pB86x4Kau LlO69DS89D3Z3WwCJx6f4Xhl3m1Up2OnPFWZs= MIME-Version: 1.0 Received: by 10.52.30.65 with SMTP id q1mr959613vdh.141.1311852766604; Thu, 28 Jul 2011 04:32:46 -0700 (PDT) Sender: laruence@gmail.com Received: by 10.220.161.130 with HTTP; Thu, 28 Jul 2011 04:32:46 -0700 (PDT) In-Reply-To: References: Date: Thu, 28 Jul 2011 19:32:46 +0800 X-Google-Sender-Auth: fkK1UhZErV-bPZgQmtS5uPt4OnA Message-ID: To: Derick Rethans Cc: PHP Internals Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] [RFC]strn(case)cmp supporting negative length as third parameter From: laruence@php.net (Laruence) Hi: why? I think this change would not cause any other side-effects. and if you are worry about INT_MAX, I think it's ok to declare with long(in fact, I already did so). thanks 2011/7/28 Derick Rethans : > On Thu, 28 Jul 2011, Laruence wrote: > >> Hi: >> >> =C2=A0 strn(case)cmp dosen't =C2=A0support a negative length as its thir= d >> paramter, =C2=A0while substr dose. >> >> =C2=A0I wrote a patch to make strn(case)cmp supporting negative length, >> make following script works as expect: >> >> =C2=A0 =C2=A0 > =C2=A0 =C2=A0if (strncmp("prefix_num", "num", -3) =3D=3D=3D 0) { >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 echo "they have same suffix\n"; >> =C2=A0 =C2=A0} >> =C2=A0 ?> >> >> =C2=A0here is the rfc: https://wiki.php.net/rfc/strncmpnegativelen > > - You're changing binary API of some API functions, so this can't go > =C2=A0into PHP 5.3: > > =C2=A0 =C2=A0 =C2=A0 =C2=A0-ZEND_API int zend_binary_strncmp(const char *= s1, uint len1, const char *s2, uint len2, uint length); > =C2=A0 =C2=A0 =C2=A0 =C2=A0+ZEND_API int zend_binary_strncmp(const char *= s1, uint len1, const char *s2, uint len2, int length); > > cheers, > Derick > > -- > http://derickrethans.nl | http://xdebug.org > Like Xdebug? Consider a donation: http://xdebug.org/donate.php > twitter: @derickr and @xdebug > --=20 Laruence =C2=A0Xinchen Hui http://www.laruence.com/