1.2.866. Numeric Literal Separator¶
Integer and floats may be written with internal underscores. This way, it is possible to separate large number into smaller groups, and make them more readable.
Numeric Literal Separators were introduced in PHP 7.4 and are not backward compatible.
<?php
$a = 1_000_000_000; // A billion
$a = 1000000000; // A billion too...
$b = 107_925_284.88; // 6 light minute to kilometers = 107925284.88 kilometers
$b = 107925284.88; // Same as above
?>
See also PHP RFC: Numeric Literal Separator.
1.2.866.1. Specs¶
Short name |
Php/IntegerSeparatorUsage |
Rulesets |
|
Exakat since |
1.9.0 |
PHP Version |
With PHP 7.4 and more recent |
Severity |
|
Time To Fix |
|
Precision |
Very high |
Features |
integer-separator |
Available in |