Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:78039 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 41990 invoked from network); 14 Oct 2014 17:25:21 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Oct 2014 17:25:21 -0000 Authentication-Results: pb1.pair.com header.from=smalyshev@sugarcrm.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=smalyshev@sugarcrm.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain sugarcrm.com designates 108.166.43.67 as permitted sender) X-PHP-List-Original-Sender: smalyshev@sugarcrm.com X-Host-Fingerprint: 108.166.43.67 smtp67.ord1c.emailsrvr.com Linux 2.6 Received: from [108.166.43.67] ([108.166.43.67:59050] helo=smtp67.ord1c.emailsrvr.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 2D/1C-18603-08C5D345 for ; Tue, 14 Oct 2014 13:25:21 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp1.relay.ord1c.emailsrvr.com (SMTP Server) with ESMTP id 9B30838047C; Tue, 14 Oct 2014 13:25:18 -0400 (EDT) X-Virus-Scanned: OK Received: by smtp1.relay.ord1c.emailsrvr.com (Authenticated sender: smalyshev-AT-sugarcrm.com) with ESMTPSA id AEEC738059D; Tue, 14 Oct 2014 13:25:17 -0400 (EDT) X-Sender-Id: smalyshev@sugarcrm.com Received: from Stass-MacBook-Pro.local (108-66-6-48.lightspeed.sntcca.sbcglobal.net [108.66.6.48]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA) by 0.0.0.0:465 (trex/5.2.13); Tue, 14 Oct 2014 17:25:17 GMT Message-ID: <543D5C78.9040905@sugarcrm.com> Date: Tue, 14 Oct 2014 10:25:12 -0700 Organization: SugarCRM User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:31.0) Gecko/20100101 Thunderbird/31.1.2 MIME-Version: 1.0 To: Andrea Faulds CC: PHP Internals References: <8C47FA53-0964-49C0-963C-332A936348A5@ajf.me> <543CE41B.5020308@sugarcrm.com> In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [RFC] Big Integer Support From: smalyshev@sugarcrm.com (Stas Malyshev) Hi! > I'm not sure what this would solve. Sure, you could just use objects > instead of a new type, but both present exactly the same challenges. > Adding a new type isn't hard in itself. The problem is updating > everything which handles numbers and their associated tests. This Exactly. Since objects are convertable to numbers (and to anything, in fact) we get double profit here - we make objects work better and we achieve big integer support. And we don't need to handle new type where we don't need numbers > doesn't make my job any easier. It also wouldn't cover a few places > that a new type can, like constants. Another problem is this means I'm not sure I see much case for bigint constants. Would be pretty hard for me to come up with a case where you need such a constant, and if you do, you could just have a string constant and convert it to GMP in runtime. > that bigints are a separate thing from ints, meaning users have to > worry about a new type which sometimes behaves differently. This > isn't good. Under this RFC's proposal, however, bigints are a mere > implementation detail. So far as the user cares, there are just > ints. No, they are not implementation detail - they are whole new type, which means every extension and every piece of PHP code aware of types now needs to know about it and needs special code to handle it. I.e. you pass it to mysql - mysql needs to handle this type. You pass it to SOAP - SOAP needs to handle this type. Etc. But if it's an object, they already deal with objects, one way or another. > Making it optional destroys most of the benefits of the RFC. Instead > of reducing platform differences, it adds a massive new one. Now I'm not saying we have to make it optional. I'm just saying it's possible. > developers have to check whether or not bigints are enabled and have > two different code paths. That's much worse than the status quo. I don't see why you'd have two code paths. If you need bigints and they are not there, then you just fail, like with any extension your code needs and is not installed. If it's there, you just continue working. All the code existing now doesn't need bigints, and even in the future most code won't need it. But for some code it would just work like before, only with unlimited range now. -- Stanislav Malyshev, Software Architect SugarCRM: http://www.sugarcrm.com/