New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement Numeric Literal Separator RFC #4165
Closed
Closed
Conversation
This file contains 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
nikic
reviewed
May 15, 2019
81aae12
to
1d1a67c
Compare
1d1a67c
to
a1ec76e
Compare
nikic
reviewed
May 27, 2019
nikic
reviewed
May 27, 2019
c5a72ff
to
7aa4ff7
Compare
bishopb
reviewed
May 28, 2019
8513393
to
4fab590
Compare
4fab590
to
2e0d667
Compare
Merged as f74109d into 7.4. Thanks! |
@nikic Does this need to be reflected in php-parser? I don't see any grammar changes |
@TomasVotruba It needs to be supported in the emulative lexer. |
@nikic I see. I'll check it |
jrfnl
added a commit
to jrfnl/PHPCompatibility
that referenced
this issue
Jun 29, 2019
✨ PHP 7.4: New NewNumericLiteralSeparator sniff > Added support for underscore separators in numeric literals. Some examples: > > 6.674_083e-11; // float > 299_792_458; // decimal > 0xCAFE_F00D; // hexadecimal > 0b0101_1111; // binary Refs: * https://github.com/php/php-src/blob/8f4e24eeef7bd1c39fabf5bea016abb287a4c606/UPGRADING#L189-L196 * https://wiki.php.net/rfc/numeric_literal_separator * php/php-src#4165 * php/php-src@f74109d Related to 808
jrfnl
added a commit
to jrfnl/PHPCompatibility
that referenced
this issue
Jun 29, 2019
✨ PHP 7.4: New NewNumericLiteralSeparator sniff > Added support for underscore separators in numeric literals. Some examples: > > 6.674_083e-11; // float > 299_792_458; // decimal > 0xCAFE_F00D; // hexadecimal > 0b0101_1111; // binary Refs: * https://github.com/php/php-src/blob/8f4e24eeef7bd1c39fabf5bea016abb287a4c606/UPGRADING#L189-L196 * https://wiki.php.net/rfc/numeric_literal_separator * php/php-src#4165 * php/php-src@f74109d Related to 808
jrfnl
added a commit
to jrfnl/PHPCompatibility
that referenced
this issue
Jun 30, 2019
✨ PHP 7.4: New NewNumericLiteralSeparator sniff > Added support for underscore separators in numeric literals. Some examples: > > 6.674_083e-11; // float > 299_792_458; // decimal > 0xCAFE_F00D; // hexadecimal > 0b0101_1111; // binary Refs: * https://github.com/php/php-src/blob/8f4e24eeef7bd1c39fabf5bea016abb287a4c606/UPGRADING#L189-L196 * https://wiki.php.net/rfc/numeric_literal_separator * php/php-src#4165 * php/php-src@f74109d Related to 808
jrfnl
added a commit
to jrfnl/PHPCompatibility
that referenced
this issue
Jul 1, 2019
✨ PHP 7.4: New NewNumericLiteralSeparator sniff > Added support for underscore separators in numeric literals. Some examples: > > 6.674_083e-11; // float > 299_792_458; // decimal > 0xCAFE_F00D; // hexadecimal > 0b0101_1111; // binary Refs: * https://github.com/php/php-src/blob/8f4e24eeef7bd1c39fabf5bea016abb287a4c606/UPGRADING#L189-L196 * https://wiki.php.net/rfc/numeric_literal_separator * php/php-src#4165 * php/php-src@f74109d Related to 808
jrfnl
added a commit
to jrfnl/PHPCompatibility
that referenced
this issue
Jul 1, 2019
✨ PHP 7.4: New NewNumericLiteralSeparator sniff > Added support for underscore separators in numeric literals. Some examples: > > 6.674_083e-11; // float > 299_792_458; // decimal > 0xCAFE_F00D; // hexadecimal > 0b0101_1111; // binary Refs: * https://github.com/php/php-src/blob/8f4e24eeef7bd1c39fabf5bea016abb287a4c606/UPGRADING#L189-L196 * https://wiki.php.net/rfc/numeric_literal_separator * php/php-src#4165 * php/php-src@f74109d Related to 808
jrfnl
added a commit
to jrfnl/PHPCompatibility
that referenced
this issue
Jul 22, 2019
✨ PHP 7.4: New NewNumericLiteralSeparator sniff > Added support for underscore separators in numeric literals. Some examples: > > 6.674_083e-11; // float > 299_792_458; // decimal > 0xCAFE_F00D; // hexadecimal > 0b0101_1111; // binary Refs: * https://github.com/php/php-src/blob/8f4e24eeef7bd1c39fabf5bea016abb287a4c606/UPGRADING#L189-L196 * https://wiki.php.net/rfc/numeric_literal_separator * php/php-src#4165 * php/php-src@f74109d Related to 808
jrfnl
added a commit
to PHPCompatibility/PHPCompatibility
that referenced
this issue
Mar 27, 2020
New sniff to detect PHP 7.4 numeric literals with an underscore separator. > Added support for underscore separators in numeric literals. Some examples: > > 6.674_083e-11; // float > 299_792_458; // decimal > 0xCAFE_F00D; // hexadecimal > 0b0101_1111; // binary Refs: * https://www.php.net/manual/en/migration74.new-features.php#migration74.new-features.core.numeric-literal-separator * https://github.com/php/php-src/blob/8f4e24eeef7bd1c39fabf5bea016abb287a4c606/UPGRADING#L189-L196 * https://wiki.php.net/rfc/numeric_literal_separator * php/php-src#4165 * php/php-src@f74109d Related to 808
jrfnl
added a commit
to PHPCompatibility/PHPCompatibility
that referenced
this issue
Mar 27, 2020
New sniff to detect PHP 7.4 numeric literals with an underscore separator. > Added support for underscore separators in numeric literals. Some examples: > > 6.674_083e-11; // float > 299_792_458; // decimal > 0xCAFE_F00D; // hexadecimal > 0b0101_1111; // binary Refs: * https://www.php.net/manual/en/migration74.new-features.php#migration74.new-features.core.numeric-literal-separator * https://github.com/php/php-src/blob/8f4e24eeef7bd1c39fabf5bea016abb287a4c606/UPGRADING#L189-L196 * https://wiki.php.net/rfc/numeric_literal_separator * php/php-src#4165 * php/php-src@f74109d Related to 808
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
https://wiki.php.net/rfc/numeric_literal_separator
Enables improved code readability by supporting an underscore between digits in numeric literals. For example: