4 ms·
PHP 7.4 numeric literal separator
Can someone explain this.
Numeric literals can contain underscores between digits.
<?php
6.674_083e-11; // float
299_792_458; // decimal
0xCAFE_F00D; // hexadecimal
0b0101_1111; // binary
?>
Why would you allow unsercsores in numbers?
- Piskvorrr 7y agoHere's the original proposal, with rationale. https://wiki.php.net/rfc/numeric_literal_separator https://wiki.php.net/rfc/numeric_literal_separator TL;DR: supposedly better readability.