On Fri, 10 Jun 2011, Hannes Landeholm wrote:

> What are the reasoning behind this? I think the PHP integer size 
> should be changed to always be 64 bit - independent of the platform. I 
> have stumbled on this annoying inconsistency several times the last 
> month.

I agree that that should be the same. But sadly, Windows uses a 
different integer size model than almost everything else modern.
Where Linux and Mac and other unices use 8 bytes for an "int", Windows 
uses 4 bytes 
(http://en.wikipedia.org/wiki/LP64#Specific_C-language_data_models).
Because PHP internally uses "int" for its integer type, on Windows 
that's still only 32 bit.

But yes, it would be awesome if PHP actually took care of this and uses 
64 bit ints on 64 bit processors.

> Also, telling developers that "an integer always
> supports 64 bit" will make life much easier for them when they need it for
> implementing large numbers in cryptography, date arithmetics, scientific
> values, API interaction, etc etc.

PHP's DateTime classes do use 64 bit integers internally, no matter on 
which processor (even 32bit ones).

cheers,
Derick

-- 
http://derickrethans.nl | http://xdebug.org
Like Xdebug? Consider a donation: http://xdebug.org/donate.php
twitter: @derickr and @xdebug

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

Reply via email to