Skip to content

avoid PHP 8.5 deprecation in applyComplement - #4

Open
guillaume-ernst wants to merge 1 commit into
chdemko:developfrom
guillaume-ernst:fix-php-85-chr-deprecation
Open

guillaume-ernst wants to merge 1 commit into
chdemko:developfrom
guillaume-ernst:fix-php-85-chr-deprecation

Conversation

@guillaume-ernst

Copy link
Copy Markdown

Fix the PHP 8.5 deprecation triggered when applyComplement() passes a negative integer to chr().

The complemented value is now masked with 0xFF, preserving the expected 8-bit complement while ensuring that chr() receives a value between 0 and 255.

A regression test was added to convert PHP 8.5 deprecations into exceptions, demonstrating the issue and preventing it from being reintroduced.

Verified with PHP 8.5.11: 140 tests and 154 assertions pass without deprecations from applyComplement().

@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 5 complexity · 0 duplication

Metric Results
Complexity 5
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant