ID: 42989
User updated by: naox at o2 dot pl
Reported By: naox at o2 dot pl
Status: Open
Bug Type: Math related
Operating System: linux and windows
PHP Version: 5.2.4
New Comment:
This actualy comes downs to this:
<?php
$a = -4738698913;
echo sprintf('%b', $a);
?>
On windows it produces proper
11100101100011010011000101011111
However on linux its
10000000000000000000000000000000
Previous Comments:
------------------------------------------------------------------------
[2007-10-16 12:59:23] naox at o2 dot pl
Description:
------------
Following script will output DIFFRENT result on windows and linux.
Tested with php-5.2.4, php-5.2.0, php-4.4.7
PHP compiled on linux centos 4.5
[EMAIL PROTECTED] [/usr] uname -a
Linux sv2.vipserv.org 2.6.21.5-grsec-xxxx-grs-ipv4-32 #7 SMP Thu Sep 13
10:22:01 CEST 2007 i686 i686 i386 GNU/Linux
with
'./configure' '--prefix' '/usr/php-5.2.4.cgi'
'--enable-force-cgi-redirect' '--with-xml' '--with-curl=/usr/curl'
'--enable-exif' '--enable-ftp' '--with-gd' '--with-jpeg-dir=/usr/local'
'--with-png-dir=/usr' '--with-xpm-dir=/usr/X11R6' '--with-iconv'
'--with-imap' '--with-imap-ssl' '--with-kerberos' '--with-pear'
'--with-pgsql=/var/pgsql/bin/pg_config' '--enable-sockets'
'--enable-track-vars' '--with-ttf' '--with-freetype-dir=/usr'
'--enable-gd-native-ttf' '--with-zlib' '--with-gettext'
'--enable-bcmath' '--with-bz2'
'--with-mysqli=/var/mysql5/bin/mysql_config' '--with-mysql=/var/mysql5'
'--with-pdo' '--with-pdo-mysql' '--without-sqlite' '--with-xsl'
'--enable-mbstring' '--with-pdo-pgsql' '--enable-soap'
Reproduce code:
---------------
<?php
$a = (float) -4738698913;
$g = (int) 43814;
$a ^= $g;
echo $a;
?>
Expected result:
----------------
On windows:
-443704711
On linux:
-2147439834
Windows output is correct result!
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=42989&edit=1