What are the potential pitfalls of using leading zeros in PHP when working with number sequences?

Using leading zeros in PHP when working with number sequences can lead to unexpected behavior when performing mathematical operations or comparisons. This is because PHP treats numbers with leading zeros as octal (base 8) numbers, which can result in incorrect calculations. To avoid this issue, it is recommended to use the `intval()` function to convert the string with leading zeros to an integer.

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