Re: 32 bit / 64 bit integer confusion
| From: | Derick Rethans | Date: | Fri, 10 Jun 2011 16:52:49 +0000 |
| Subject: | Re: 32 bit / 64 bit integer confusion | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-53248@lists.php.net to get a copy of this message | ||
On Fri, 10 Jun 2011, Stas Malyshev wrote:
> > 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.
>
> Erm...
> typedef union _zvalue_value {
> long lval; /* long value */
> double dval; /* double value */
>
> ITYM PHP uses "long" which unfortunately isn't long on windows.
Yes, indeed. That was a typo. The original point still stands though.
And IMO, this should be fixed in the Windows port so that on 64 bit
processors, the PHP "int" type (the C "long" type) is actually 64 bits,
just like almost any other current operating system/compiler set-up.
cheers,
Derick
--
http://derickrethans.nl | http://xdebug.org
Like Xdebug? Consider a donation: http://xdebug.org/donate.php
twitter: @derickr and @xdebug