[php-src] Issue #12676: xor logical operation incorrect.
| From: | netcarver | Date: | Wed, 15 Nov 2023 13:40:37 +0000 |
| Subject: | [php-src] Issue #12676: xor logical operation incorrect. | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-245807@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/12676
Author: netcarver
### Description
The following code:
```php
<?php
$a = true;
$b = true;
$xor = $a xor $b;
var_export(compact('a', 'b', 'xor'));
```
Resulted in this output:
```
array(
'a' => true,
'b' => true,
'xor' => true,
)
```
But I expected this output instead:
```
array(
'a' => true,
'b' => true,
'xor' => false,
)
```
Xor should result in false if both inputs are true.
### PHP Version
PHP 8.2.12
### Operating System
Manjaro (Arch) Linux