ID: 49974
User updated by: admin at saltwaterc dot net
-Summary: Windows x64 build lacks proper suport for 64-bit
signed long
Reported By: admin at saltwaterc dot net
Status: Assigned
Bug Type: Scripting Engine problem
Operating System: win32 only - Windows x64
PHP Version: 5.2.11
Assigned To: pajoye
New Comment:
Well, even though 5.2 doesn't have support - it does compile. The task
manager shows the runtime as native 64-bit app.
The assertion test was the whole idea: assertion failed. In unit
testing, the assertions should not fail in order to pass the test. I
simply changed 2147483647 with 3147483647 (the first digit) in order to
make it to fail a test that should not fail under x64, but fails under
x86. It could have been 31474836470 which I assure you that its
32-bit float representation won't pass as integer, but under 64-bit is
fine. Under Windows, yes, it displays your output for PHP_INT_MAX with
either a x86 build or a x64 build. I know what's the upper limit for
32-bit signed long, where under 64-bit the PHP integer should be a
signed long long.
Under Debian/Ubuntu/Linux, the 5.2.x x86_64 builds:
(Ubuntu Hardy)
rem...@ubuntuvz:~$ php -r 'echo PHP_INT_MAX."\n";'
9223372036854775807
rem...@ubuntuvz:~$ php -v
PHP 5.2.4-2ubuntu5.7 with Suhosin-Patch 0.9.6.2 (cli) (built: Aug 21
2009 22:17:39)
Copyright (c) 1997-2007 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies
rem...@ubuntuvz:~$ php long.php
rem...@ubuntuvz:~$ # no failure here
(Debian Lenny)
saltwa...@web:~$ php -r 'echo PHP_INT_MAX."\n";'
9223372036854775807
saltwa...@web:~$ php -v
PHP 5.2.6-1+lenny3 with Suhosin-Patch 0.9.6.2 (cli) (built: Apr 26 2009
20:09:03)
Copyright (c) 1997-2008 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2008 Zend Technologies
with Xdebug v2.0.3, Copyright (c) 2002-2007, by Derick Rethans
with Suhosin v0.9.27, Copyright (c) 2007, by SektionEins GmbH
saltwa...@web:~$ php long.php
saltwa...@web:~$ # no failure here either
(Ubuntu Karmic)
saltwa...@karmic:~$ php -r 'echo PHP_INT_MAX."\n";'
9223372036854775807
saltwa...@karmic:~$ php -v
PHP 5.2.10-2ubuntu5 with Suhosin-Patch 0.9.7 (cli) (built: Oct 13 2009
18:33:05)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies
saltwa...@karmic:~$ php long.php
saltwa...@karmic:~$ # again - no failure
(Debian Lenny - Quick setup with Zend Server CE)
r...@php-test:~# php -r 'echo PHP_INT_MAX."\n";'
9223372036854775807
r...@php-test:~# php -v
PHP 5.3.0 (cli) (built: Jul 21 2009 08:21:24)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2009 Zend Technologies
with Zend Extension Manager v5.1, Copyright (c) 2003-2009, by Zend
Technologies
- with Zend Data Cache v4.0, Copyright (c) 2004-2009, by Zend
Technologies [loaded] [licensed] [disabled]
- with Zend Utils v1.0, Copyright (c) 2004-2009, by Zend
Technologies [loaded] [licensed] [enabled]
- with Zend Optimizer+ v4.0, Copyright (c) 1999-2009, by Zend
Technologies [loaded] [licensed] [disabled]
- with Zend Debugger v5.2, Copyright (c) 1999-2009, by Zend
Technologies [loaded] [licensed] [enabled]
r...@php-test:~# php long.php
r...@php-test:~# # still nothing
(Debian Lenny - same machine, my own build)
r...@php-test:~# php -i | grep conf
Configure Command => './configure' '--prefix=/opt/local'
'--disable-cgi' '--with-layout=gnu'
r...@php-test:~# php -r 'echo PHP_INT_MAX."\n";'
9223372036854775807
r...@php-test:~# php -v
PHP 5.3.0 (cli) (built: Oct 23 2009 22:40:27)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2009 Zend Technologies
r...@php-test:~# php long.php
r...@php-test:~#
(CentOS 5.3 - Quick setup with Zend Server CE)
[r...@php-test-cent ~]# php -r 'echo PHP_INT_MAX."\n";'
[blah, some PHP strict timezone complains]
9223372036854775807
[r...@php-test-cent ~]# php -v
PHP 5.3.0 (cli) (built: Aug 25 2009 03:54:07)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2009 Zend Technologies
with Zend Extension Manager v5.1, Copyright (c) 2003-2009, by Zend
Technologies
- with Zend Data Cache v4.0, Copyright (c) 2004-2009, by Zend
Technologies [loaded] [licensed] [disabled]
- with Zend Utils v1.0, Copyright (c) 2004-2009, by Zend
Technologies [loaded] [licensed] [enabled]
- with Zend Optimizer+ v4.0, Copyright (c) 1999-2009, by Zend
Technologies [loaded] [licensed] [disabled]
- with Zend Debugger v5.2, Copyright (c) 1999-2009, by Zend
Technologies [loaded] [licensed] [enabled]
[r...@php-test-cent ~]# php long.php
[r...@php-test-cent ~]# # CentOS passes as well
Previous Comments:
[2009-10-23 19:25:26] paj...@php.net
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