RE: [PHP-DEV] 32 bit / 64 bit integer confusion
| From: | John Crenshaw | Date: | Fri, 10 Jun 2011 17:08:11 +0000 |
| Subject: | RE: [PHP-DEV] 32 bit / 64 bit integer confusion | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-53250@lists.php.net to get a copy of this message | ||
> ITYM PHP uses "long" which unfortunately isn't long on windows.
>
> --
> Stanislav Malyshev, Software Architect
> SugarCRM: http://www.sugarcrm.com/
> (408)454-6900 ext. 227
This is not exactly correct. I think what you meant to say, is "long isn't the same size
as a pointer on Windows".
Long us guaranteed only to be able to hold up to 4 bytes of data. That some platforms compile it to
a size larger than 4 bytes is an unfortunate deviation from what (IMO) should be the norm of holding
EXACTLY the minimum required size. In any case, any code that expects long to hold more than 4 bytes
is fundamentally broken. See http://stackoverflow.com/questions/589575/c-size-of-int-long-etc#answer-589684
and http://jk-technology.com/c/inttypes.html#limits
John Crenshaw
Priacta, Inc.