What is the issue with using leading zeros in PHP numbers?

Using leading zeros in PHP numbers can cause unexpected behavior because PHP interprets numbers with leading zeros as octal (base 8) numbers. This can lead to incorrect calculations or comparisons if not handled properly. To solve this issue, you can use the intval() function to convert the number to a decimal (base 10) integer.

$number = '0123';
$decimalNumber = intval($number);
echo $decimalNumber; // Output: 123