Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:80681 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 37205 invoked from network); 17 Jan 2015 05:56:55 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 Jan 2015 05:56:55 -0000 Authentication-Results: pb1.pair.com header.from=pierre.php@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=pierre.php@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.216.45 as permitted sender) X-PHP-List-Original-Sender: pierre.php@gmail.com X-Host-Fingerprint: 209.85.216.45 mail-qa0-f45.google.com Received: from [209.85.216.45] ([209.85.216.45:60632] helo=mail-qa0-f45.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 65/3A-16533-6A9F9B45 for ; Sat, 17 Jan 2015 00:56:55 -0500 Received: by mail-qa0-f45.google.com with SMTP id n8so18238401qaq.4 for ; Fri, 16 Jan 2015 21:56:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=Y2m6HNDgZz9YEP3+a86IA1x4xSTLax1XcagvEKGbx3Y=; b=0YdGwF8KnTvMB8eSbFyxKnGuMTNiwx86nr5O2JUrqv0cIMJ/6ROeFD9gIdN1afXFNo vCVrgKDtt+g4EC7RxCPGL2GbByWFJWsNHPPf/FIgX+GGUkbTEKgvWHPuHdu6o21UsCaR 4BofrrqCoDJrGz1oKpeuPhnpoi3b/x+S9OESwRB0WiepOOFnyl2QKtNu2B2EYNU4PnRO 34ogBBkvfJE2Y1rP/4W8IUDgDIzvj/lHcfDzrEVRR+p5QhU0vqkaNturaSrhvWAeJOvZ 5QHRysuXXnMwyMEg3RgreJaCCDCMjsj6NCFtAXNZCiANopoR04Sw3DYH6ItlgPJ4YxrZ R7Lw== MIME-Version: 1.0 X-Received: by 10.140.89.18 with SMTP id u18mr20957696qgd.20.1421474212222; Fri, 16 Jan 2015 21:56:52 -0800 (PST) Received: by 10.140.22.106 with HTTP; Fri, 16 Jan 2015 21:56:52 -0800 (PST) In-Reply-To: <2DD279B4-E872-4FDA-9FDC-12770D4BF052@ajf.me> References: <53CEC194.5090307@marc-bennewitz.de> <2DD279B4-E872-4FDA-9FDC-12770D4BF052@ajf.me> Date: Sat, 17 Jan 2015 06:56:52 +0100 Message-ID: To: Andrea Faulds Cc: Marc Bennewitz , PHP internals Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] unsinged integer From: pierre.php@gmail.com (Pierre Joye) On Sat, Jan 17, 2015 at 4:32 AM, Andrea Faulds wrote: > Hi Marc, > > This is an unusual follow-up from me. > > Particularly on 32-bit systems, it would be useful to have a =E2=80=98u= =E2=80=99 zend_parse_parameters specifier for an unsigned integer. Unfortun= ately, again, I don=E2=80=99t think native unsigned integers (IS_ULONG) wil= l get into PHP. But it looks like the bigint RFC probably will, and here=E2= =80=99s the opportunity. > > With the bigint RFC, we could add a =E2=80=98u=E2=80=99 specifier. You=E2= =80=99d get a native ulong (zpp would convert from long or bigint), and cou= ld easily produce a long/bigint from your ulong if you need to return one (= add RETURN_ULONG which implicitly converts?). > > Now, it=E2=80=99s not as fast as a native IS_ULONG type would be, but we = could still do things like properly support file sizes in the 2GB-4GB range= on 32-bit, at least. :) > > What do you think? It looks to me like yet another can of worms (how do you deal with conversions, mixed operations, etc. it adds a lot of special cases) with little benefits. 32bit environments are dying species. There are ways to support LFS without that as well (while I doubt the effort is worth it). So if I'd to choose whether PHP should support unsigned integer, my gut feeling right now is no, it should not. Cheers, --=20 Pierre @pierrejoye | http://www.libgd.org