Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:83164 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 68953 invoked from network); 19 Feb 2015 09:36:26 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Feb 2015 09:36:26 -0000 Authentication-Results: pb1.pair.com header.from=lester@lsces.co.uk; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=lester@lsces.co.uk; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain lsces.co.uk from 217.147.176.214 cause and error) X-PHP-List-Original-Sender: lester@lsces.co.uk X-Host-Fingerprint: 217.147.176.214 mail4-2.serversure.net Linux 2.6 Received: from [217.147.176.214] ([217.147.176.214:50334] helo=mail4.serversure.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id D7/96-22021-89EA5E45 for ; Thu, 19 Feb 2015 04:36:25 -0500 Received: (qmail 6743 invoked by uid 89); 19 Feb 2015 09:36:22 -0000 Received: by simscan 1.3.1 ppid: 6737, pid: 6740, t: 0.0796s scanners: attach: 1.3.1 clamav: 0.96/m:52/d:10677 Received: from unknown (HELO ?10.0.0.8?) (lester@rainbowdigitalmedia.org.uk@86.189.147.37) by mail4.serversure.net with ESMTPA; 19 Feb 2015 09:36:22 -0000 Message-ID: <54E5AE95.9080702@lsces.co.uk> Date: Thu, 19 Feb 2015 09:36:21 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: internals@lists.php.net References: <54E51B9E.1060201@gmx.de> <54E53408.90005@lsces.co.uk> <54E53D80.5040407@gmx.de> In-Reply-To: <54E53D80.5040407@gmx.de> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Re: [RFC-Discuss] Scalar Type Declarations v0.5 From: lester@lsces.co.uk (Lester Caine) On 19/02/15 01:33, Christoph Becker wrote: > Lester Caine wrote: > >> On 18/02/15 23:09, Christoph Becker wrote: >>> It seems to me that this behavior is hard to deal with generally for >>> programmers as well as static analyzers. Andreas' bigint RFC[1] would >>> solve that issue, but it has been withdrawn, and AFAIK nobody is working >>> on it. OTOH, bigint would make the widening from int to float >>> potentially even more lossy (i.e. inaccurate) than it is now (64bit ints >>> vs. IEEE 754 doubles). >> >> The 'unconstrained integer' RFC adds it' own problems, but the int -> >> float overflow is only a problem with 32bit builds anyway. 64bit builds >> will not overflow until they run out of space anyway. > > It seems to me you're thinking too much (maybe only?) about "database > types". IMHO PHP can be used more versatile, and there might be issues > which are exemplified in the RFC[1]: > > var_dump(2 ** 64); // float(1.844674407371E+19) > > Clearly an int->float overflow that'll also happen on 64bit builds. > > [1] > You see this has nothing to do with 'Scalar Type Declarations' ... this is a problem in it's own right that needs sorting as part of the general 64bit 'upgrading' and providing a proper fix for 64bit numbers is something which the 'unconstrained integer' RFC addressed but in my book it was always the wrong fix, and providing a cross platform fix for BIGINT which provides a simple integer value is the correct fix. The voting on that RFC seemed to agree. We need 64bit values in several places where simply clipping to 32bit ones is no longer the correct fix. -- Lester Caine - G8HFL ----------------------------- Contact - http://lsces.co.uk/wiki/?page=contact L.S.Caine Electronic Services - http://lsces.co.uk EnquirySolve - http://enquirysolve.com/ Model Engineers Digital Workshop - http://medw.co.uk Rainbow Digital Media - http://rainbowdigitalmedia.co.uk