private function getGCD($a, $b)
    {
        if (extension_loaded('gmp')) {
            return gmp_intval(gmp_gcd((string)$a, (string)$b));
        }
        $large = $a > $b ? $a : $b;
        $small = $a > $b ? $b : $a;
        $remainder = $large % $small;
        return 0 === $remainder ? $small : $this->getGCD($small, $remainder);
    }