Tests are made at 64-bit system!
php7 has a nice function: intdiv(). The following code works perfect:
intdiv()
$number = 0x7fffffffffffffff; $result
You can use the % operator to get the remainder. Then after subtraction of the remainder perform the division:
%
$rem = $number % 62; $result = ($number - $rem) / 62;