protected function fixIntegerOverflow($int) { if ($int < 0) { $int += 2.0 * (PHP_INT_MAX + 1); } return $int; }