src/CFPropertyList/CFBinaryPropertyList.php
protected static function make64Int($hi, $lo)
    {
      // on x64, we can just use int
        if (PHP_INT_SIZE > 4) {
            return (((int)$hi)<<32) | ((int)$lo);
        }

      // lower word has to be unsigned since we don't use bitwise or, we use bcadd/gmp_add
        $lo = sprintf("%u", $lo);

      // use GMP or bcmath if possible
        if (function_exists("gmp_mul")) {
            return gmp_strval(gmp_add(gmp_mul($hi, "4294967296"), $lo));
        }

        if (function_exists("bcmul")) {
            return bcadd(bcmul($hi, "4294967296"), $lo);
        }

        if (class_exists('Math_BigInteger')) {
            $bi = new \Math_BigInteger($hi);
            return $bi->multiply(new \Math_BigInteger("4294967296"))->add(new \Math_BigInteger($lo))->toString();
        }

        throw new PListException("either gmp or bc has to be installed, or the Math_BigInteger has to be available!");
    }
protected static function make64Int($hi, $lo)
    {
      // on x64, we can just use int
        if (PHP_INT_SIZE > 4) {
            return (((int)$hi)<<32) | ((int)$lo);
        }

      // lower word has to be unsigned since we don't use bitwise or, we use bcadd/gmp_add
        $lo = sprintf("%u", $lo);

      // use GMP or bcmath if possible
        if (function_exists("gmp_mul")) {
            return gmp_strval(gmp_add(gmp_mul($hi, "4294967296"), $lo));
        }

        if (function_exists("bcmul")) {
            return bcadd(bcmul($hi, "4294967296"), $lo);
        }

        if (class_exists('Math_BigInteger')) {
            $bi = new \Math_BigInteger($hi);
            return $bi->multiply(new \Math_BigInteger("4294967296"))->add(new \Math_BigInteger($lo))->toString();
        }

        throw new PListException("either gmp or bc has to be installed, or the Math_BigInteger has to be available!");
    }
protected static function make64Int ( $ hi , $ lo ) { // on x64, we can just use int if ( PHP_INT_SIZE > 4 ) { return ( ( ( int ) $ hi ) << 32 ) | ( ( int ) $ lo ) ; } // lower word has to be unsigned since we don't use bitwise or, we use bcadd/gmp_add $ lo = sprintf ( "%u" , $ lo ) ; // use GMP or bcmath if possible if ( function_exists ( "gmp_mul" ) ) { return gmp_strval ( gmp_add ( gmp_mul ( $ hi , "4294967296" ) , $ lo ) ) ; } if ( function_exists ( "bcmul" ) ) { return bcadd ( bcmul ( $ hi , "4294967296" ) , $ lo ) ; } if ( class_exists ( 'Math_BigInteger' ) ) { $ bi = new \ Math_BigInteger ( $ hi ) ; return $ bi -> multiply ( new \ Math_BigInteger ( "4294967296" ) ) -> add ( new \ Math_BigInteger ( $ lo ) ) -> toString ( ) ; } throw new PListException ( "either gmp or bc has to be installed, or the Math_BigInteger has to be available!" ) ; }
Create an 64 bit integer using bcmath or gmp
@param int $hi The higher word
@param int $lo The lower word
@return mixed The integer (as int if possible, as string if not possible)
@throws PListException if neither gmp nor bc available
Create an 64 bit integer using bcmath or gmp