Hexadecimal Separator

../_images/hexadecimal_separator.png

PHP offers a number separator since PHP 8.0: _. It may be added inside any integer or float, to make long list of digits more readable.

In fact, this also applies to the other integer notations: hexadecimal, octal, binary, etc. Just don’t put it inside the header, like 0_x_1, but in the body of the integer.

Interestingly, the separator does not work in string sequences, like inside an hexadecimal unicode representation.

See Also

PHP Error Messages

PHP Features