Skip to content

TokenGroup::isNumber(): correctly handle PHP 7.4 numeric literals and PHP 8.1 octal literals#1891

Merged
wimg merged 1 commit intodevelopfrom
feature/tokengroup-isnumber-allow-for-php-7.4-and-8.1-numeric-literals
Sep 1, 2025
Merged

TokenGroup::isNumber(): correctly handle PHP 7.4 numeric literals and PHP 8.1 octal literals#1891
wimg merged 1 commit intodevelopfrom
feature/tokengroup-isnumber-allow-for-php-7.4-and-8.1-numeric-literals

Conversation

@jrfnl
Copy link
Copy Markdown
Member

@jrfnl jrfnl commented Aug 26, 2025

Using the PHPCSUtils Numbers class and using the decimal value determined via that class prevents issues with PHP 7.4+ numeric literals with underscores and PHP 8.1+ octal literals when the sniffs are being run on PHP < 7.4.

Includes tests.

… PHP 8.1 octal literals

Using the PHPCSUtils `Numbers` class and using the decimal value determined via that class prevents issues with PHP 7.4+ numeric literals with underscores and PHP 8.1+ octal literals when the sniffs are being run on PHP < 7.4.

Includes tests.
@wimg wimg merged commit a9c671a into develop Sep 1, 2025
49 checks passed
@wimg wimg deleted the feature/tokengroup-isnumber-allow-for-php-7.4-and-8.1-numeric-literals branch September 1, 2025 16:03
@github-actions github-actions bot removed PR: ready for review PR: quick merge PR only contains relatively simple changes labels Sep 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants