What are common pitfalls when using PHP for Collatz calculations?

One common pitfall when using PHP for Collatz calculations is not properly handling integer overflow when dealing with extremely large numbers. To solve this issue, you can use the `gmp` extension in PHP, which provides functions for arbitrary precision arithmetic.

<?php
$number = gmp_init(12345678901234567890);
while (gmp_cmp($number, 1) > 0) {
    if (gmp_even($number)) {
        $number = gmp_div($number, 2);
    } else {
        $number = gmp_mul($number, 3);
        $number = gmp_add($number, 1);
    }
}
echo gmp_strval($number);
?>