Rev 1116 | Rev 1130 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1116 | Rev 1121 | ||
---|---|---|---|
Line 245... | Line 245... | ||
245 | * @param $to |
245 | * @param $to |
246 | * @return float|int|mixed|string|null |
246 | * @return float|int|mixed|string|null |
247 | */ |
247 | */ |
248 | public function distance($to) { |
248 | public function distance($to) { |
249 | if (!is_object($to)) $to = OIDplusObject::parse($to); |
249 | if (!is_object($to)) $to = OIDplusObject::parse($to); |
- | 250 | if (!$to) return null; |
|
250 | if (!($to instanceof $this)) return null; |
251 | if (!($to instanceof $this)) return null; |
251 | $res = ipv6_distance($to->ipv6, $this->ipv6); |
252 | $res = ipv6_distance($to->ipv6, $this->ipv6); |
252 | return $res !== false ? $res : null; |
253 | return $res !== false ? $res : null; |
253 | } |
254 | } |
254 | 255 |