Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:75897 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 8575 invoked from network); 22 Jul 2014 22:04:27 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 22 Jul 2014 22:04:27 -0000 Authentication-Results: pb1.pair.com smtp.mail=ajf@ajf.me; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=ajf@ajf.me; sender-id=pass Received-SPF: pass (pb1.pair.com: domain ajf.me designates 192.64.116.207 as permitted sender) X-PHP-List-Original-Sender: ajf@ajf.me X-Host-Fingerprint: 192.64.116.207 imap2-2.ox.privateemail.com Received: from [192.64.116.207] ([192.64.116.207:60963] helo=imap2-2.ox.privateemail.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C0/F4-21666-AEFDEC35 for ; Tue, 22 Jul 2014 18:04:26 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.privateemail.com (Postfix) with ESMTP id DE9078C0080; Tue, 22 Jul 2014 18:04:23 -0400 (EDT) X-Virus-Scanned: Debian amavisd-new at imap2.ox.privateemail.com Received: from mail.privateemail.com ([127.0.0.1]) by localhost (imap2.ox.privateemail.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id Dslvrr1_kxnT; Tue, 22 Jul 2014 18:04:23 -0400 (EDT) Received: from [192.168.0.15] (unknown [90.210.122.167]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.privateemail.com (Postfix) with ESMTPSA id 4D1858C007D; Tue, 22 Jul 2014 18:04:14 -0400 (EDT) Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) In-Reply-To: <53CEA453.9050700@mabe.berlin> Date: Tue, 22 Jul 2014 23:04:04 +0100 Cc: internals@lists.php.net Content-Transfer-Encoding: quoted-printable Message-ID: References: <53CEA453.9050700@mabe.berlin> To: Marc Bennewitz X-Mailer: Apple Mail (2.1878.6) Subject: Re: [PHP-DEV] unsinged integer From: ajf@ajf.me (Andrea Faulds) On 22 Jul 2014, at 18:50, Marc Bennewitz wrote: > I like to create an RFC to add an unsinged integer type for the > following purposes: >=20 > - higher max value > - DBs already allow UNSIGNED INT/BIGINT which is a farce to work with > in PHP > - better support pack/unpack unsigned integers from/to PHP using the > un/pack functions > - simplified right shift of unsinged integers because PHP "safes" the > sing bit on singed integers which leads to bugs or overcomplicated = code > if you need that bit for others than a sign > - if a parameter type-hint or similar functionality will be = implemented > this type will be very useful, too. Else it will be also useful to = make > sure you have no negative integer by simply converting to it. >=20 > What do you think? > (Does it worth the expense for a RFC?) This would be likely to cause endless problems since signed integers are = used so widely and things would break on conversion, for quite limited = gain. I=92m currently proposing and implementing bigints for PHP 6: = http://wiki.php.net/rfc/bigint This would solve your problem (any unsigned integer would fit) but would = cause less issues. -- Andrea Faulds http://ajf.me/