/** * @dataProvider validIPs * * @param $ip * @param $dotted_quad * @param $integer */ public function testInteger($ip, $dotted_quad, $integer) { $ip = new IPv4Address($ip); $int = $ip->int(); $this->assertEquals($integer, $int); }
/** * Return whether this address is the networkś broadcast address (all-ones) * * @return int */ public function isBroadCastAddress() { $netmask_inverted = 0xffffffff & ~$this->netmask->int(); return ($this->ip->int() & $netmask_inverted) === $netmask_inverted; }