public static function binToDec($bin, $length = 0)
    {
        $gmp = gmp_init($bin, 2);
        $dec = gmp_strval($gmp, 10);

        return self::pad($dec, $length);
    }
public static function binToDec($bin, $length = 0)
    {
        $gmp = gmp_init($bin, 2);
        $dec = gmp_strval($gmp, 10);

        return self::pad($dec, $length);
    }
public static function binToDec ( $ bin , $ length = 0 ) { $ gmp = gmp_init ( $ bin , 2 ) ; $ dec = gmp_strval ( $ gmp , 10 ) ; return self :: pad ( $ dec , $ length ) ; }
Converts binary string into decimal string.

@param string $bin    Binary string.
@param int    $length Minimum output length.

@return string Decimal string.
Converts binary string into decimal string .