php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #4358 new XOR breaks compatibility with php3
Submitted: 2000-05-09 15:08 UTC Modified: 2000-06-09 15:37 UTC
From: chrism at four dot net Assigned:
Status: Closed Package: Scripting Engine problem
PHP Version: 4.0 Release Candidate 1 OS: freebsd3.3
Private report: No CVE-ID: None
 [2000-05-09 15:08 UTC] chrism at four dot net
<?php

$result = (98 xor 200);

echo gettype($result) . "\n";

echo $result . "\n";
?>

twinhead% php3.0.14 -q xor.php
integer
170
twinhead% php -q xor.php
boolean

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-06-09 15:37 UTC] andi at cvs dot php dot net
Both in PHP 3 and PHP 4 bitwise xor is ^ and logical xor is xor.
I think you meant to use ^.
Try: $result = (98 ^ 200);

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Jun 28 10:01:31 2024 UTC