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);
    }
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);
    }
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 ) ; }
Returns the greatest common divisor of two integers using the Euclidean algorithm.

@param int $a
@param int $b
@return int
Returns the greatest common divisor of two integers using the Euclidean algorithm .