コード例 #1
0
ファイル: Range.php プロジェクト: olragon/iptools
 /**
  * @return int
  */
 public function count()
 {
     if ($this->firstIP->getVersion() === IP::IP_V4) {
         $count = $this->lastIP->toLong() - $this->firstIP->toLong();
     } else {
         $count = bcsub($this->lastIP->toLong(), $this->firstIP->toLong());
     }
     return $count;
 }
コード例 #2
0
ファイル: Range.php プロジェクト: s1lentium/iptools
 /**
  * @return int
  */
 public function count()
 {
     return (int) bcadd(bcsub($this->lastIP->toLong(), $this->firstIP->toLong()), 1);
 }