php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #8173 problem with "xor" and "not"
Submitted: 2000-12-08 12:02 UTC Modified: 2000-12-08 16:27 UTC
From: artymiak at safenet dot pl Assigned:
Status: Closed Package: Scripting Engine problem
PHP Version: 4.0.3pl1 OS: OpenBSD 2.7
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: artymiak at safenet dot pl
New email:
PHP Version: OS:

 

 [2000-12-08 12:02 UTC] artymiak at safenet dot pl
The following lines of code do not produce any output:
echo (0 xor 0);
echo (1 xor 1);
echo (!1);

while these lines of code return expected values:
echo (1 xor 0);
echo (0 xor 1);
echo (!0);


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-12-08 16:27 UTC] hholzgra@php.net
the result of  xor in PHP4 is of type boolean (true or false), not integer
and 'echo true' produces a '1' as output while 'echo false' produces
the empy string

see alse
http://www.php.net/manual/language.operators.logical.php
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Sat Oct 10 09:00:01 2026 UTC