src/SubnetCalculator.php
private function hostCalculation($format, $separator = '')
    {
        $network_quads = [
            sprintf("$format", $this->quads[0] & ~($this->subnet_mask >> 24)),
            sprintf("$format", $this->quads[1] & ~($this->subnet_mask >> 16)),
            sprintf("$format", $this->quads[2] & ~($this->subnet_mask >>  8)),
            sprintf("$format", $this->quads[3] & ~($this->subnet_mask >>  0)),
        ];

        return implode($separator, $network_quads);
    }
private function hostCalculation($format, $separator = '')
    {
        $network_quads = [
            sprintf("$format", $this->quads[0] & ~($this->subnet_mask >> 24)),
            sprintf("$format", $this->quads[1] & ~($this->subnet_mask >> 16)),
            sprintf("$format", $this->quads[2] & ~($this->subnet_mask >>  8)),
            sprintf("$format", $this->quads[3] & ~($this->subnet_mask >>  0)),
        ];

        return implode($separator, $network_quads);
    }
private function hostCalculation ( $ format , $ separator = '' ) { $ network_quads = [ sprintf ( "$format" , $ this -> quads [ 0 ] & ~ ( $ this -> subnet_mask >> 24 ) ) , sprintf ( "$format" , $ this -> quads [ 1 ] & ~ ( $ this -> subnet_mask >> 16 ) ) , sprintf ( "$format" , $ this -> quads [ 2 ] & ~ ( $ this -> subnet_mask >> 8 ) ) , sprintf ( "$format" , $ this -> quads [ 3 ] & ~ ( $ this -> subnet_mask >> 0 ) ) , ] ; return implode ( $ separator , $ network_quads ) ; }
Calculate host portion for formatting

@param string $format    sprintf format to determine if decimal, hex or binary
@param string $separator implode separator for formatting quads vs hex and binary

@return string formatted subnet mask
Calculate host portion for formatting