Explicit octal notation for integers by Girgias · Pull Request #6360 · php/php-src
Girgias
deleted the
explicit-octal-notation
branch
jrfnl added a commit to PHPCSStandards/PHPCSUtils that referenced this pull request
Feb 28, 2022This add support for the explicit octal notation using a `0o`/`0O` prefix as supported in PHP as of PHP 8.1. The only method which needed adjusting was the `Numbers::getCompleteNumber()` method, which now backfills the tokenization when needed. For the `Numbers::isOctalInt()` method, a small tweak to the regex was all that was needed. As for the `Numbers::getDecimalValue()` method: this already handled the conversion correctly due to the use of the PHP native `octdec()` function. From the RFC: > Surprisingly PHP already has support for this notation when using the `octdec()` and `base_convert()` functions. Includes adding unit tests to safeguard support in all relevant methods in the class. Refs: * https://wiki.php.net/rfc/explicit_octal_notation * php/php-src#6360 * squizlabs/PHP_CodeSniffer#3481 * squizlabs/PHP_CodeSniffer#3552
jrfnl
mentioned this pull request
jrfnl added a commit to PHPCompatibility/PHPCompatibility that referenced this pull request
Dec 5, 2022jrfnl added a commit to PHPCompatibility/PHPCompatibility that referenced this pull request
Dec 5, 2022
jrfnl
mentioned this pull request
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters