Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:75027 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 91583 invoked from network); 21 Jun 2014 11:02:20 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 21 Jun 2014 11:02:20 -0000 Authentication-Results: pb1.pair.com smtp.mail=danack@basereality.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=danack@basereality.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain basereality.com from 74.125.82.45 cause and error) X-PHP-List-Original-Sender: danack@basereality.com X-Host-Fingerprint: 74.125.82.45 mail-wg0-f45.google.com Received: from [74.125.82.45] ([74.125.82.45:46270] helo=mail-wg0-f45.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 63/00-25700-A3665A35 for ; Sat, 21 Jun 2014 07:02:19 -0400 Received: by mail-wg0-f45.google.com with SMTP id l18so4667536wgh.28 for ; Sat, 21 Jun 2014 04:02:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=CCbnFhvHgYJsSQNI9PN0oQqwoK5YN2DbdRgFb/hTb2c=; b=AEMV/HbYAQiY6Tm4AgqIh/CbrA/sgH69qs59ZtQZYk97GTvHlij8W1ZR2KlIRo/QeV 2qhvOG76hMvWr6Rk0JhvfUQawpMoJXxXvX8JQDsMRWcZukF4goCdrtQz0TvkQCQBDJtF ZixjBH6WUbX2fya2IDjL+XOqH4/A6VwzMW9N3tC+vXFziH9rblHQn35GN+pyWi5Fk3zq +zsUNEZLht6OwKiILoogKpQH7kcLzejk2GbMP5kW7qRM+X3+7DrfWeTFMY6qm1s6u5NH 7amslBu5X+KBwGkk2lh4iJYB4d0dwRbQ2ZZWC4g+VxVeV0JTDxCkB/hdL0FsiFGkNcl0 D7Lg== X-Gm-Message-State: ALoCoQlneLi062hv4tKaPKl+hRupG9xM6rLXns75+Z9U4TC6gwWdhTXdo+jRCjoxr27H6vah/1P2 MIME-Version: 1.0 X-Received: by 10.180.89.233 with SMTP id br9mr10780443wib.14.1403348535768; Sat, 21 Jun 2014 04:02:15 -0700 (PDT) Received: by 10.217.90.70 with HTTP; Sat, 21 Jun 2014 04:02:15 -0700 (PDT) X-Originating-IP: [78.147.5.170] In-Reply-To: References: Date: Sat, 21 Jun 2014 12:02:15 +0100 Message-ID: To: Andrea Faulds Cc: PHP Internals Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] [DRAFT][RFC] Big Integer Support From: danack@basereality.com (Dan Ackroyd) Hi, An interesting RFC, that could do with some fleshing out. In particular: What is the behaviour when you add 0.5 to a value that is a bigint? What is the behaviour when a bigint zval is used in an extension that is then going to then pass it to an underlying library that is expecting a 64bit value? Will all the extension authors need to start casting and/or checking the values? There are quite a few functions in the GMP library, which presumably are useful in handling bigints. Are these going to be exposed to users? If so, how? Most of all though, it could do with a stronger argument for why handling bigints 'automagically' like this is preferable to handling them explicitly. Without great care for handling them, dealing with very large numbers is still going to fail at some point. Although handling integers as bigints explicitly is more code to write, it's also results in more understandable behaviour, which seems better to me than having more internal converting of types which is not visible in userland. Finally, the RFC should probably address the licensing issues that would be involved in making GMP an integral part of PHP, not just for how PHP is distributed, but also for how people making and distributing PHP applications would be affected. For reference the GMP library is dual-licensed under GNU LGPL v3 and GNU GPL v2.0. As I understand it, these are not compatible with the PHP license. cheers Dan On 20 June 2014 01:35, Andrea Faulds wrote: > Good evening again, > > I=E2=80=99ve been working on a patch to add bigints to PHP for more than = a fortnight now. It=E2=80=99d based on the phpng branch and very much unfin= ished, but is somewhat working. > > A draft RFC is available here: https://wiki.php.net/rfc/bigint > > It=E2=80=99s quite far from done, but I wanted to start some discussion n= ow as finishing the patch will take some time. > > Thanks! > > -- > Andrea Faulds > http://ajf.me/ > > > > > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php >