计算两个地点之间的距离(米)
@param string $name1 地点名称
@param string $name2
@return float 米
174679
public function getDistance(string $name1, string $name2): float
    {
        return $this->handle->rawCommand('geodist', [$this->name, $name1, $name2]);
    }
1319227
public function get($name = '', $prefix = null) {
        $prefix = !is_null($prefix) ? $prefix : $this->prefix;
        if ('' == $name) {
            // 获取全部的session
            $value = $prefix ? (!empty($_SESSION[$prefix]) ? $_SESSION[$prefix] : []) : $_SESSION;
        }
        elseif ($prefix) {
            // 获取session
            if (strpos($name, '.')) {
                list($name1, $name2) = explode('.', $name);
                $value = isset($_SESSION[$prefix][$name1][$name2]) ? $_SESSION[$prefix][$name1][$name2] : null;
            }
            else {
                $value = isset($_SESSION[$prefix][$name]) ? $_SESSION[$prefix][$name] : null;
            }
        }
        else {
            if (strpos($name, '.')) {
                list($name1, $name2) = explode('.', $name);
                $value = isset($_SESSION[$name1][$name2]) ? $_SESSION[$name1][$name2] : null;
            }
            else {
                $value = isset($_SESSION[$name]) ? $_SESSION[$name] : null;
            }
        }
        return $value;
    }
422418
public static function sub($num1, $num2)
    {
        if (!static::is($num1) || !static::is($num2)) {
            throw new \InvalidArgumentException("The \$num1 and \$num2 parameters must be numeric.");
        }

        return ($num1 - $num2);
    }
1165259
public function getCurrencyObject($name)
    {
        $search = $this->getCurrencyArray();
        foreach ($search as $cur) {
            if ($cur->name == $name) {
                return $cur;
            }
        }
    }
1156898
private function getAnnotationIndex($name)
    {
        for($i = 0; $i < count($this->annotations); $i++)
        {
            if($this->annotations[$i] instanceof $name)
            {
                return $i;
            }
        }

        return -1;
    }
741656
private function comparePreReleaseIdentifier($identifier1, $identifier2) : int
    {
        $mineIsInt  = $this->isIdentifierInt($identifier1);
        $theirIsInt = $this->isIdentifierInt($identifier2);

        if ($mineIsInt !== $theirIsInt) {
            return $mineIsInt ? -1 : 1;
        }

        if ($mineIsInt) {
            return ((int) $identifier1) <=> ((int) $identifier2);
        }

        return $identifier1 <=> $identifier2;
    }
307671
public function getColumnNumber($name)
    {
        $name = trim($name);
        if (array_key_exists($name, $this->lookup)) {
            return $this->lookup[$name];
        }
        if ($this->throwException) {
            throw new \RuntimeException("name '$name' not found");
        }
        return -1;
    }
542938
public static function mathSubtract($decimal1, $decimal2) {
        if (!is_numeric($decimal1)) {
            throw new Exception("decimal1 is not a numeric value: " . $decimal1);
        }

        if (!is_numeric($decimal2)) {
            throw new Exception("decimal2 is not a numeric value: " . $decimal2);
        }

        return round($decimal1 - $decimal2, StaticEb::$roundPrecision);
    }
25924
public static function getDistance($lat1, $long1, $lat2, $long2) {
        return self::distanceFactory($lat1, $long1, $lat2, $long2)->get();
    }
317643
protected function float(string $name): Closure
    {
        // precision and scale both seems to be ignored in Doctrine so not much sense to have them as inputs

        return function (Table $table) use ($name) {
            $table->addColumn($name, Type::FLOAT)->setNotnull(true);
        };
    }
115904
public function &__get($name)
    {
        // This method must return a reference and not use ternary operators for __set()ing multi-dimensional arrays
        // http://stackoverflow.com/questions/4310473/using-set-with-arrays-solved-but-why
        // http://stackoverflow.com/questions/5966918/return-null-by-reference-via-get
        switch ($name) {
            case 'global':
                if (is_null(static::$global)) {
                    static::$global = new Container;
                }

                return static::$global;
                break;
            case 'session':
                if (is_null(static::$session)) {
                    static::$session = new Session;
                }

                return static::$session;
                break;
            case 'request':
            case 'dir':
            case 'url':
            case 'html':
                return $this->$name;
                break;
            default:
                return $this->html[strtolower($name)];
                break;
        }
    }
1328798
public static function mul($float1, $float2)
    {
        if (!static::is($float1) || !static::is($float2)) {
            throw new \InvalidArgumentException("The \$float1 and \$float2 parameters must be of type float.");
        }

        return ($float1 * $float2);
    }
944313
public static function find_or_create($name)
	{
		$hztp = new self();

		if (is_numeric($name))
		{
			$hztp->id = $name;
		}
		else
		{
			$hztp->name = $name;
		}

		if ($hztp->read() == false)
		{
			if ($hztp->create() == false)
			{
				return false;
			}
		}

		return $hztp;
	}
241900
public static function diffDays(\DateTime $dateTime1, \DateTime $dateTime2): int
    {
        $diff = $dateTime1->diff($dateTime2);

        return (int)$diff->format('%a');
    }
939051
protected function min(float $value1 = null, float $value2 = null) {
        $temp1 = $value1 ?: 0;
        $temp2 = $value2 ?: 0;

        $tempmin = min($temp1, $temp2);

        if (!$tempmin && $value1 !== 0 && $value2 !== 0) {
            $min = null;
        } else {
            $min = $tempmin;
        }

        return $min;
    }
1237649
public static function benchmark(string $name = '') {
		if (self::$debug) {
			static $start = NULL;
			static $total = 0;
			$benchmark = 0;
			if (is_null($start)) {
				$start = self::getMicrotime();
			} else {
				$temp = self::getMicrotime();
				$benchmark = $temp - $start;
				$start = $temp;
			}
			$total+= $benchmark;
			self::$data['benchmark'][] = [
				'name' => $name,
				'time' => \Format::timeSeconds($benchmark) . '',
				'total' => \Format::timeSeconds($total),
				'start' => \Format::datetime($start, ['skip_user_timezone' => true]),
				'memory' => memory_get_peak_usage(true)
			];
		}
	}
1116148
public function comp(MoneyInterface $first, MoneyInterface $second)
    {
        $this->resolveCurrency($first, $second);
        return $this->math->comp($first->getAmount(), $second->getAmount());
    }