Skip to content

Allow GMP in increment/decrement operations#5530

Merged
VincentLanglet merged 2 commits intophpstan:2.1.xfrom
Firehed:gmp-inc-dec-fix
Apr 26, 2026
Merged

Allow GMP in increment/decrement operations#5530
VincentLanglet merged 2 commits intophpstan:2.1.xfrom
Firehed:gmp-inc-dec-fix

Conversation

@Firehed
Copy link
Copy Markdown
Contributor

@Firehed Firehed commented Apr 24, 2026

Summary

  • Add GMP to allowed types in InvalidIncDecOperationRule
  • GMP supports ++ and -- via operator overloading (since PHP 5.6)

Relates to phpstan/phpstan#13965 (partially - addresses inc/dec for GMP; unary +/- still need UnaryOperatorTypeSpecifyingExtension)

Test plan

  • Added test for GMP increment/decrement operations
  • All existing tests pass

🤖 Generated with Claude Code

@Firehed
Copy link
Copy Markdown
Contributor Author

Firehed commented Apr 24, 2026

@VincentLanglet based on your comment in phpstan/phpstan-strict-rules#311

@VincentLanglet VincentLanglet requested a review from staabm April 24, 2026 22:53
Firehed and others added 2 commits April 26, 2026 09:06
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@VincentLanglet VincentLanglet merged commit 9009697 into phpstan:2.1.x Apr 26, 2026
653 of 658 checks passed
@VincentLanglet
Copy link
Copy Markdown
Contributor

Thanks @Firehed

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.

3 participants