Skip to content

[DeadCode] Keep PHP_VERSION_ID check that can fail on the minimum version in RemovePhpVersionIdCheckRector - #9054

Merged
TomasVotruba merged 1 commit into
mainfrom
fix-php-version-id-check-off-by-one
Nov 24, 2026
Merged

TomasVotruba merged 1 commit into
mainfrom
fix-php-version-id-check-off-by-one

Conversation

@TomasVotruba

Copy link
Copy Markdown
Member

With PHP 8.0 as the minimum, PHP_VERSION_ID can be exactly 80000. Three comparisons were treated as decided, while they flip on that exact version:

  • PHP_VERSION_ID > 80000 - false on 8.0.0, was unwrapped as always true
  • 80000 < PHP_VERSION_ID - same
  • 80000 >= PHP_VERSION_ID - true on 8.0.0, was removed as always false

Each is now decided only when the minimum is strictly past the compared version. The existing fixtures move to 70400 so they still cover the change, and 3 skip_*_same_version fixtures cover the equality.

@TomasVotruba
TomasVotruba merged commit 1ae371f into main Nov 24, 2026
51 checks passed
@TomasVotruba
TomasVotruba deleted the fix-php-version-id-check-off-by-one 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