Skip to content

[DeadCode] Compare loosely on == and != in UnwrapFutureCompatibleIfPhpVersionRector - #9053

Merged
TomasVotruba merged 1 commit into
mainfrom
fix-unwrap-future-compatible-inversed
Nov 24, 2026
Merged

TomasVotruba merged 1 commit into
mainfrom
fix-unwrap-future-compatible-inversed

Conversation

@TomasVotruba

Copy link
Copy Markdown
Member

ConditionEvaluator says "weak comparison on purpose" for == and !=, but compares with === and !==. So version_compare('7.2', PHP_VERSION, '<') == 1 evaluated as 1 === true → false, and the rule kept the else branch, though the if branch is the one that runs on any PHP above 7.2.

Now == and != compare loosely, and the compare_to_integer_inversed fixture expects the if branch.

@TomasVotruba
TomasVotruba merged commit da60d90 into main Nov 24, 2026
51 checks passed
@TomasVotruba
TomasVotruba deleted the fix-unwrap-future-compatible-inversed branch November 24, 2026 16:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant