Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:54231 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 4632 invoked from network); 28 Jul 2011 11:41:08 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 28 Jul 2011 11:41:08 -0000 Authentication-Results: pb1.pair.com smtp.mail=pierre.php@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=pierre.php@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.213.170 as permitted sender) X-PHP-List-Original-Sender: pierre.php@gmail.com X-Host-Fingerprint: 209.85.213.170 mail-yx0-f170.google.com Received: from [209.85.213.170] ([209.85.213.170:38498] helo=mail-yx0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 0D/0A-50004-3DA413E4 for ; Thu, 28 Jul 2011 07:41:08 -0400 Received: by yxk8 with SMTP id 8so1589186yxk.29 for ; Thu, 28 Jul 2011 04:41:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=QRUc8s3kdBI8WVBSzxvQp6ipfR8V1u6+OxImNYI1OWQ=; b=s+Ga6Kz6TZgqKT23QctFgdVRBX95UjXTl9SRH6vlshm3NPCVpNyFV9kPyy8VZ3d3G/ 39b6SlFI+C5bruzyET5KhV6c5nYOPpX41hV1vLDPYMCPaEJWRk0ob5SCKeMtb2u0eHEp 8GDqhSe1g/+QP0k1sSxJpqJ6G5e3DqwC7VLZM= MIME-Version: 1.0 Received: by 10.236.75.136 with SMTP id z8mr975476yhd.47.1311853265200; Thu, 28 Jul 2011 04:41:05 -0700 (PDT) Received: by 10.147.35.15 with HTTP; Thu, 28 Jul 2011 04:41:05 -0700 (PDT) In-Reply-To: References: Date: Thu, 28 Jul 2011 13:41:05 +0200 Message-ID: To: Laruence Cc: Derick Rethans , PHP Internals Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] [RFC]strn(case)cmp supporting negative length as third parameter From: pierre.php@gmail.com (Pierre Joye) the signature is not the same anymore, some extension may not build anymore (depending on the compiler used and its flag). Cheers, On Thu, Jul 28, 2011 at 1:32 PM, Laruence wrote: > Hi: > > why? > > I think this change would not cause any other side-effects. > > and if you are worry about INT_MAX, =A0I 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: >>> >>> =A0 strn(case)cmp dosen't =A0support a negative length as its third >>> paramter, =A0while substr dose. >>> >>> =A0I wrote a patch to make strn(case)cmp supporting negative length, >>> make following script works as expect: >>> >>> =A0 =A0 >> =A0 =A0if (strncmp("prefix_num", "num", -3) =3D=3D=3D 0) { >>> =A0 =A0 =A0 =A0 echo "they have same suffix\n"; >>> =A0 =A0} >>> =A0 ?> >>> >>> =A0here is the rfc: https://wiki.php.net/rfc/strncmpnegativelen >> >> - You're changing binary API of some API functions, so this can't go >> =A0into PHP 5.3: >> >> =A0 =A0 =A0 =A0-ZEND_API int zend_binary_strncmp(const char *s1, uint le= n1, const char *s2, uint len2, uint length); >> =A0 =A0 =A0 =A0+ZEND_API int zend_binary_strncmp(const char *s1, uint le= n1, 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 >> > > > > -- > Laruence =A0Xinchen Hui > http://www.laruence.com/ > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > --=20 Pierre @pierrejoye | http://blog.thepimp.net | http://www.libgd.org