/** * @dataProvider matchAddresses */ public function testMatch(IPv4Address $ip1, $ip2, $equal) { $this->assertEquals($equal, $ip1->match($ip2)); }
/** * 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; }