Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:75894 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 98418 invoked from network); 22 Jul 2014 20:34:00 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 22 Jul 2014 20:34:00 -0000 Authentication-Results: pb1.pair.com header.from=nikita.ppv@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=nikita.ppv@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.219.54 as permitted sender) X-PHP-List-Original-Sender: nikita.ppv@gmail.com X-Host-Fingerprint: 209.85.219.54 mail-oa0-f54.google.com Received: from [209.85.219.54] ([209.85.219.54:63537] helo=mail-oa0-f54.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 96/83-21666-4BACEC35 for ; Tue, 22 Jul 2014 16:33:58 -0400 Received: by mail-oa0-f54.google.com with SMTP id n16so309078oag.27 for ; Tue, 22 Jul 2014 13:33:53 -0700 (PDT) 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; bh=YMN61eQIBoRjZNAXF6ZrHV6t5s2qY9tXBY7CS5SnXTU=; b=eim8LEhzKz8tJ39g/KeElmkLfP6tOYGtSGnOqCNvCkeEC9vyRYEXPUaVZjZhNHOX0n JhMWD9ysbNf2zsvuDrlKWfbr7+s3W5g4Z0pDBQ7zdyuNat78X6ppfQxyOjFcLvpbqzcb ZEDzI0Fgxpf/UezOU1/qNvM1iC6Lq40E9MJl05OARod36ei8iZjS1nBUkWYXxRM8E1Sr kjDqYo+e+qe9WgJ30NmIT9Gn5hqlSWKgs2BET4vWR1rsF5KwNxhP/tOfjVVn6az0/mn5 QjmrQU0qeZFTwRG2ysvcmExF/cTIWALkylTtMJijDyhh306Dhxop9UlsrHas7TX6jolF AYCg== MIME-Version: 1.0 X-Received: by 10.182.142.69 with SMTP id ru5mr53088478obb.6.1406061233583; Tue, 22 Jul 2014 13:33:53 -0700 (PDT) Received: by 10.182.132.2 with HTTP; Tue, 22 Jul 2014 13:33:53 -0700 (PDT) In-Reply-To: <53CEC194.5090307@marc-bennewitz.de> References: <53CEC194.5090307@marc-bennewitz.de> Date: Tue, 22 Jul 2014 22:33:53 +0200 Message-ID: To: Marc Bennewitz Cc: PHP internals Content-Type: multipart/alternative; boundary=001a11c2d5ce5c3b7a04fece248c Subject: Re: [PHP-DEV] unsinged integer From: nikita.ppv@gmail.com (Nikita Popov) --001a11c2d5ce5c3b7a04fece248c Content-Type: text/plain; charset=UTF-8 On Tue, Jul 22, 2014 at 9:55 PM, Marc Bennewitz wrote: > Hi all, > > I like to create an RFC to add an unsinged integer type for the > following purposes: > > - 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. > > What do you think? > (Does it worth the expense for a RFC?) > Could you please further clarify what you mean by "type" here? If you mean an actual new type (like integers currently are), then I highly doubt this is feasible (implementationally). If you mean something like an UnsignedInt class with overloaded operators, that should be easy to implement. Not sure if we want it in core though. Nikita --001a11c2d5ce5c3b7a04fece248c--