php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #36254 wrong xor result
Submitted: 2006-02-01 23:10 UTC Modified: 2006-02-01 23:29 UTC
From: mail at young dot org dot ua Assigned:
Status: Not a bug Package: Math related
PHP Version: 5.1.2 OS: 6.0-RELEASE-p4
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: mail at young dot org dot ua
New email:
PHP Version: OS:

 

 [2006-02-01 23:10 UTC] 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)

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-02-01 23:29 UTC] tony2001@php.net
Because bitwise operators work with integers and you're trying to use float/double values.
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Wed Sep 30 07:01:23 2020 UTC