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