Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:83139 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 90923 invoked from network); 19 Feb 2015 01:33:51 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Feb 2015 01:33:51 -0000 Authentication-Results: pb1.pair.com smtp.mail=cmbecker69@gmx.de; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=cmbecker69@gmx.de; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmx.de designates 212.227.17.20 as permitted sender) X-PHP-List-Original-Sender: cmbecker69@gmx.de X-Host-Fingerprint: 212.227.17.20 mout.gmx.net Received: from [212.227.17.20] ([212.227.17.20:59708] helo=mout.gmx.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 69/82-08593-E7D35E45 for ; Wed, 18 Feb 2015 20:33:51 -0500 Received: from [192.168.0.101] ([91.67.244.80]) by mail.gmx.com (mrgmx103) with ESMTPSA (Nemesis) id 0M2tKM-1XX7BE0Rks-00sgHq; Thu, 19 Feb 2015 02:33:46 +0100 Message-ID: <54E53D80.5040407@gmx.de> Date: Thu, 19 Feb 2015 02:33:52 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Lester Caine , internals@lists.php.net References: <54E51B9E.1060201@gmx.de> <54E53408.90005@lsces.co.uk> In-Reply-To: <54E53408.90005@lsces.co.uk> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:+hoQHmVHn2mgljxSXvBct152AwJgcYWbNcktyPXcTwidumU25BL 3GF7hO5LjNusi/X6/7h3QjCY93lbUaYWH57ubibkOSBkTcV4j27sq3RaxlYpJHld39rGGD0 Wiu6f4QWDxZ2Qr7M4fQTF4zt1fDpS1YAyJUzfVEcp2SlfFZnEcTgb0w1qYfTDoLSGsDukKW iUEiIpt9Ni6FvUiGeM2+A== X-UI-Out-Filterresults: notjunk:1; Subject: Re: [PHP-DEV] Re: [RFC-Discuss] Scalar Type Declarations v0.5 From: cmbecker69@gmx.de (Christoph Becker) 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] -- Christoph M. Becker