protected function IPLongAnd($long1, $long2)
    {
        $result = 0;
        for ($bit = 0; $bit < static::NB_BITS; $bit++) {
            $div = bcpow(2, $bit);
            $and = bcmod(bcdiv($long1, $div, 0), 2) && bcmod(bcdiv($long2, $div, 0), 2);
            $result = bcadd($result, bcmul($and, $div));
        }
        return $result;
    }
protected function IPLongAnd($long1, $long2)
    {
        $result = 0;
        for ($bit = 0; $bit < static::NB_BITS; $bit++) {
            $div = bcpow(2, $bit);
            $and = bcmod(bcdiv($long1, $div, 0), 2) && bcmod(bcdiv($long2, $div, 0), 2);
            $result = bcadd($result, bcmul($and, $div));
        }
        return $result;
    }
protected function IPLongAnd ( $ long1 , $ long2 ) { $ result = 0 ; for ( $ bit = 0 ; $ bit < static :: NB_BITS ; $ bit ++ ) { $ div = bcpow ( 2 , $ bit ) ; $ and = bcmod ( bcdiv ( $ long1 , $ div , 0 ) , 2 ) && bcmod ( bcdiv ( $ long2 , $ div , 0 ) , 2 ) ; $ result = bcadd ( $ result , bcmul ( $ and , $ div ) ) ; } return $ result ; }
Logic AND between two IP Longs

@param mixed $long1 IP Long
@param mixed $long2 IP Long

@return string
Logic AND between two IP Longs