#36254 [Opn->Bgs]: wrong xor result

From: Date: Wed, 01 Feb 2006 22:29:30 +0000
Subject: #36254 [Opn->Bgs]: wrong xor result
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-92807@lists.php.net to get a copy of this message
ID: 36254 Updated by: tony2001@php.net Reported By: mail at young dot org dot ua -Status: Open +Status: Bogus Bug Type: Math related Operating System: 6.0-RELEASE-p4 PHP Version: 5.1.2 New Comment: Because bitwise operators work with integers and you're trying to use float/double values. Previous Comments: ------------------------------------------------------------------------ [2006-02-01 23:10:17] mail at young dot org dot ua Description: ------------ Part of php-code doesnt work correctly on the sigle servers, but working good at ~100 other servers. CPU: Intel(R) Pentium(R) 4 CPU 3.00GHz (3000.13-MHz 686-class CPU) Reproduce code: --------------- <?php $a = -5883499359; $b = 177392; var_dump($a); var_dump($b); $a ^= $b; var_dump($a); ?> Expected result: ---------------- float(-5883499359) int(177392) int(-1588438959) Actual result: -------------- float(-5883499359) int(177392) int(-2147306256) ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=36254&edit=1

« previous php.bugs (#92807) next »