protected static function cidrMatch32bit($ipAddr, $cidr)
    {
        list ($subNet, $bits) = explode('/', $cidr);
        $ipLong = \ip2long($ipAddr);
        $subnetLong = \ip2long($subNet);
        $mask = -1 << (32 - $bits);
        $subnetLong &= $mask; // nb: in case the supplied subnet wasn't correctly aligned
        return ($ipLong & $mask) == $subnetLong;
    }