---
title: "analyse/dead-code/xor-always-constant"
pagination: false
---

{/* Generated by scripts/gen-rule-docs.py. Edit mapping.toml, not this file. */}

<RuleId id="analyse/dead-code/xor-always-constant" />

In the [`analyse-recommended`](/docs/rules/presets/analyse-recommended) preset and every stricter one. Report only.

## Configuration

```toml title="pun.toml"
[analyse.rules]
"dead-code/xor-always-constant" = "on"
```

To skip it in some files or lines, add an [ignore comment](/docs/configuration/ignore-comments).

## Replaces

- [`LogicalXorConstantConditionRule`](https://phpstan.org/error-identifiers/logicalXor.leftAlwaysFalse) (phpstan-classes)
- [`booleanAnd.leftAlwaysFalse`](https://phpstan.org/error-identifiers/booleanAnd.leftAlwaysFalse) (phpstan)
- [`booleanAnd.rightAlwaysFalse`](https://phpstan.org/error-identifiers/booleanAnd.rightAlwaysFalse) (phpstan)
- [`booleanAnd.rightAlwaysTrue`](https://phpstan.org/error-identifiers/booleanAnd.rightAlwaysTrue) (phpstan)
- [`booleanOr.leftAlwaysTrue`](https://phpstan.org/error-identifiers/booleanOr.leftAlwaysTrue) (phpstan)
- [`booleanOr.rightAlwaysFalse`](https://phpstan.org/error-identifiers/booleanOr.rightAlwaysFalse) (phpstan)
- [`booleanOr.rightAlwaysTrue`](https://phpstan.org/error-identifiers/booleanOr.rightAlwaysTrue) (phpstan)
- [`logicalAnd.leftAlwaysFalse`](https://phpstan.org/error-identifiers/logicalAnd.leftAlwaysFalse) (phpstan)
- [`logicalAnd.leftAlwaysTrue`](https://phpstan.org/error-identifiers/logicalAnd.leftAlwaysTrue) (phpstan)
- [`logicalAnd.rightAlwaysFalse`](https://phpstan.org/error-identifiers/logicalAnd.rightAlwaysFalse) (phpstan)
- [`logicalAnd.rightAlwaysTrue`](https://phpstan.org/error-identifiers/logicalAnd.rightAlwaysTrue) (phpstan)
- [`logicalOr.leftAlwaysFalse`](https://phpstan.org/error-identifiers/logicalOr.leftAlwaysFalse) (phpstan)
- [`logicalOr.leftAlwaysTrue`](https://phpstan.org/error-identifiers/logicalOr.leftAlwaysTrue) (phpstan)
- [`logicalOr.rightAlwaysFalse`](https://phpstan.org/error-identifiers/logicalOr.rightAlwaysFalse) (phpstan)
- [`logicalOr.rightAlwaysTrue`](https://phpstan.org/error-identifiers/logicalOr.rightAlwaysTrue) (phpstan)
- [`logicalXor.leftAlwaysFalse`](https://phpstan.org/error-identifiers/logicalXor.leftAlwaysFalse) (phpstan)
- [`logicalXor.leftAlwaysTrue`](https://phpstan.org/error-identifiers/logicalXor.leftAlwaysTrue) (phpstan)
- [`logicalXor.rightAlwaysFalse`](https://phpstan.org/error-identifiers/logicalXor.rightAlwaysFalse) (phpstan)
- [`logicalXor.rightAlwaysTrue`](https://phpstan.org/error-identifiers/logicalXor.rightAlwaysTrue) (phpstan)

[More analyse/dead-code rules](/docs/rules/analyse/dead-code) · [Edit this page](https://github.com/shipfastlabs/pun/edit/main/crates/pun-config/rules/mapping.toml)
