sprintf('%04x', $word), $words); return implode(':', $groups); } protected function octets(): string { $words = array_map('hexdec', explode(':', $this->ip)); if (isset($this->mask)) { $words = array_merge($words, array_map('hexdec', explode(':', $this->mask))); } return pack('n*', ...$words); } }