private static function _intStrModulus($intStr, $divisor) {
        // If possible, use integer type for calculation.
        $int = (int) $intStr;
        if ((string) $int == (string) $intStr) {
            // Use of integer type is possible.
            return $int % $divisor;
        } else {
            // Cannot use integer type, use BC Math library.
            if (extension_loaded('bcmath')) {
                return bcmod($intStr, (string) $divisor);
            } else {
                throw new RuntimeException('BC Math functions are not available.', self::E_NO_BCMATH);
            }
        }
    }
private static function _intStrModulus($intStr, $divisor) {
        // If possible, use integer type for calculation.
        $int = (int) $intStr;
        if ((string) $int == (string) $intStr) {
            // Use of integer type is possible.
            return $int % $divisor;
        } else {
            // Cannot use integer type, use BC Math library.
            if (extension_loaded('bcmath')) {
                return bcmod($intStr, (string) $divisor);
            } else {
                throw new RuntimeException('BC Math functions are not available.', self::E_NO_BCMATH);
            }
        }
    }
private static function _intStrModulus ( $ intStr , $ divisor ) { // If possible, use integer type for calculation. $ int = ( int ) $ intStr ; if ( ( string ) $ int == ( string ) $ intStr ) { // Use of integer type is possible. return $ int % $ divisor ; } else { // Cannot use integer type, use BC Math library. if ( extension_loaded ( 'bcmath' ) ) { return bcmod ( $ intStr , ( string ) $ divisor ) ; } else { throw new RuntimeException ( 'BC Math functions are not available.' , self :: E_NO_BCMATH ) ; } } }
Calculates dividend modulus divisor.

Uses PHP's BC Math library if the dividend is too big to be processed
with PHP's internal integer type.

@param mixed $intStr Dividend as integer or as string representing an
integer.
@param int $divisor Divisor.
@return mixed Remainder as integer or as string representing an integer.
@throws RuntimeException
Calculates dividend modulus divisor .