src/SubnetCalculator.php
private function maxHostCalculation($format, $separator = '')
    {
        $network_quads         = $this->getNetworkPortionQuads();
        $number_ip_addresses   = $this->getNumberIPAddresses();

        $network_range_quads = [
            sprintf($format, ($network_quads[0] & ($this->subnet_mask >> 24)) + ((($number_ip_addresses - 1) >> 24) & 0xFF)),
            sprintf($format, ($network_quads[1] & ($this->subnet_mask >> 16)) + ((($number_ip_addresses - 1) >> 16) & 0xFF)),
            sprintf($format, ($network_quads[2] & ($this->subnet_mask >>  8)) + ((($number_ip_addresses - 1) >>  8) & 0xFF)),
            sprintf($format, ($network_quads[3] & ($this->subnet_mask >>  0)) + ((($number_ip_addresses - 1) >>  0) & 0xFE)),
        ];

        return implode($separator, $network_range_quads);
    }
private function maxHostCalculation($format, $separator = '')
    {
        $network_quads         = $this->getNetworkPortionQuads();
        $number_ip_addresses   = $this->getNumberIPAddresses();

        $network_range_quads = [
            sprintf($format, ($network_quads[0] & ($this->subnet_mask >> 24)) + ((($number_ip_addresses - 1) >> 24) & 0xFF)),
            sprintf($format, ($network_quads[1] & ($this->subnet_mask >> 16)) + ((($number_ip_addresses - 1) >> 16) & 0xFF)),
            sprintf($format, ($network_quads[2] & ($this->subnet_mask >>  8)) + ((($number_ip_addresses - 1) >>  8) & 0xFF)),
            sprintf($format, ($network_quads[3] & ($this->subnet_mask >>  0)) + ((($number_ip_addresses - 1) >>  0) & 0xFE)),
        ];

        return implode($separator, $network_range_quads);
    }
private function maxHostCalculation ( $ format , $ separator = '' ) { $ network_quads = $ this -> getNetworkPortionQuads ( ) ; $ number_ip_addresses = $ this -> getNumberIPAddresses ( ) ; $ network_range_quads = [ sprintf ( $ format , ( $ network_quads [ 0 ] & ( $ this -> subnet_mask >> 24 ) ) + ( ( ( $ number_ip_addresses - 1 ) >> 24 ) & 0xFF ) ) , sprintf ( $ format , ( $ network_quads [ 1 ] & ( $ this -> subnet_mask >> 16 ) ) + ( ( ( $ number_ip_addresses - 1 ) >> 16 ) & 0xFF ) ) , sprintf ( $ format , ( $ network_quads [ 2 ] & ( $ this -> subnet_mask >> 8 ) ) + ( ( ( $ number_ip_addresses - 1 ) >> 8 ) & 0xFF ) ) , sprintf ( $ format , ( $ network_quads [ 3 ] & ( $ this -> subnet_mask >> 0 ) ) + ( ( ( $ number_ip_addresses - 1 ) >> 0 ) & 0xFE ) ) , ] ; return implode ( $ separator , $ network_range_quads ) ; }
Calculate max host 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 max host
Calculate max host for formatting