php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #50883 PHP x64 has only 32Bit integer
Submitted: 2010-01-29 21:03 UTC Modified: 2010-01-29 22:43 UTC
From: virsacer at web dot de Assigned:
Status: Not a bug Package: Compile Failure
PHP Version: 5.3.1 OS: win32 only - Windows 7 Pro x64
Private report: No CVE-ID: None
 [2010-01-29 21:03 UTC] virsacer at web dot de
Description:
------------
I compiled PHP x64 from the Windows Sourcecode but the integer is only 32Bit.

Build Date => Jan 29 2010 13:32:28
Compiler => MSVC9 (Visual C++ 2008)
Architecture => x64
Configure Command => cscript /nologo configure.js  "--enable-snapshot-build"

Reproduce code:
---------------
php.exe -r "echo PHP_INT_MAX;"

Expected result:
----------------
Should be somthing like 9223372036854775807

Actual result:
--------------
2147483647

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-01-29 21:53 UTC] pajoye@php.net
That's expected, we use a 32bit for integer and unlike other platforms, it is portable (same type won't vary, in C).
 [2010-01-29 22:43 UTC] johannes@php.net
Just to make this clear: "we" means "Windows" in that case, the Windows developers and Visual Studio developers decided to use a 32bit type for representing the "long" data type. Many Unix(-like) operating systems decided to use a 64bit type for "long" on 64bit machines. The C standard allows both. PHP uses whatever the operating system uses. We have plans for a platform independent large integer but that needs some work, maybe it appears some day, maybe not.
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Sun Jul 05 15:01:27 2020 UTC