#49974 [Asn]: Windows x64 build lacks proper suport for 64-bit signed long
| From: | pajoye@php.net | Date: | Fri, 23 Oct 2009 19:25:26 +0000 |
| Subject: | #49974 [Asn]: Windows x64 build lacks proper suport for 64-bit signed long | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-143894@lists.php.net to get a copy of this message | ||
ID: 49974
Updated by: pajoye@php.net
Reported By: admin at saltwaterc dot net
Status: Assigned
Bug Type: Scripting Engine problem
Operating System: Windows x64, irrelevant version
PHP Version: 5.2.11
Assigned To: pajoye
New Comment:
Also given that PHP_INT_MAX is 2147483647, having 3147483647 being
stored as a float is perfectly valid.
Try to confirm:
> php -r "echo PHP_INT_MAX;"
2147483647
Previous Comments:
------------------------------------------------------------------------
[2009-10-23 19:09:23] pajoye@php.net
#49492 was a complete bogus report, not sure why you even mention it
here as it is unrelated.
To clear some points before going further:
- 5.2 has no x64 support on windows and will never have x64 support.
- We use only VC9 for the x64 builds, with the SDK 6.1
About your reproduce code. Have you tried it on linux 64bit? I don't
see a different behavior between linux and windows using 5.3. That's
expected.
It is also important to notice that 3147483647 is higher than 2^32 -1,
which is the limit of the PHP integer.
All in all I don's see that as a windows specific problem but about
supporting large integers in a consistent manner. Given that we have it
in our roadmap for future PHP versions, I will likely close this issue,
once I have run some more tests.
------------------------------------------------------------------------
[2009-10-23 16:20:25] admin at saltwaterc dot net
Description:
------------
The Windows x64 build of PHP has an issue with the integer data type.
It may have issues with floating point numbers, but I didn't test it.
The integer bugs me since I work with large integers as column primary
keys in databases. I can't check for overflows with is_int() either
(obvious).
Runtime:
- 3rd party PHP 5.2.5 x64 build
- 3rd party PHP 5.2.8 x64 build
- my own PHP 5.2.11 x64 builds
- official snapshot PHP 5.3.1RC1 (used below) - so the issue is in both
of the 5.2.x and 5.3.x branches
Compiler
- MSVC++ 8.0 Express
- MSVC++ 9.0 Express
Windows SDK:
- 6.1a
- 7.0
Since there were various versions built with various compilers and
Windwows SDKs, I tend to believe that this is a PHP build system related
issue, rather than an issue with that MSVC++ stuff.
PS: at the moment this x64 issue is a development problem as the code
goes into production on *nix machines with proper 64-bit support. Please
don't tell me the same story from report #49492. Yes, Apache doesn't
provide official x64 builds, but it is supported, thus 64-bit
development is possible. Try it yourself:
http://www.anindya.com/apache-http-server-2-2-14-x86-x64-msi-installers/
Reproduce code:
---------------
<?php // long.php
function assert_handler($file, $line, $code)
{
echo "Assertion Failed:
File '$file'
Line '$line'
Code '$code'";
}
assert_options(ASSERT_ACTIVE, 1);
assert_options(ASSERT_WARNING, 0);
assert_options(ASSERT_QUIET_EVAL, 1);
assert_options(ASSERT_CALLBACK, 'assert_handler');
assert(is_int(3147483647) === TRUE);
Expected result:
----------------
Nothing!
Actual result:
--------------
C:\Users\Saltwater\Desktop>php-5.3.1RC1-Win32-VC9-x64\php.exe long.php
Assertion Failed:
File 'C:\Users\Saltwater\Desktop\long.php'
Line '13'
Code ''
C:\Users\Saltwater\Desktop>
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=49974&edit=1