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]
> <https://wiki.php.net/rfc/scalar_type_hints_v5#integer_overflow_to_float_behavior>

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

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to