PHPackages                             tholu/php-cidr-match - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. tholu/php-cidr-match

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

tholu/php-cidr-match
====================

CIDRmatch is a library to match an IP to an IP range in CIDR notation (IPv4 and IPv6).

0.6(4mo ago)35228.9k↓23.5%10MITPHPPHP &gt;=7.4CI passing

Since Jul 7Pushed 4mo ago3 watchersCompare

[ Source](https://github.com/tholu/php-cidr-match)[ Packagist](https://packagist.org/packages/tholu/php-cidr-match)[ RSS](/packages/tholu-php-cidr-match/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (5)Dependencies (6)Versions (8)Used By (0)

[![CI](https://github.com/tholu/php-cidr-match/actions/workflows/ci.yml/badge.svg)](https://github.com/tholu/php-cidr-match/actions/workflows/ci.yml)

CIDR match
==========

[](#cidr-match)

CIDRmatch is a library to match an IP to an IP range in CIDR notation (IPv4 and IPv6).

**NOTE:** Symfony2 already does everything this library here does with its IpUtils module. Unfortunately I discovered this only after I finished working on this library.

Usage
-----

[](#usage)

```
$cidrMatch = new CIDRmatch();
$cidrMatch->match($ip, $cidr);

```

Tests
-----

[](#tests)

```
./vendor/bin/phpunit tests/CIDRmatchTest

```

###  Health Score

53

—

FairBetter than 96% of packages

Maintenance78

Regular maintenance activity

Popularity47

Moderate usage in the ecosystem

Community16

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 75% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~778 days

Recently: every ~667 days

Total

6

Last Release

123d ago

PHP version history (3 changes)0.1PHP &gt;=5.3

0.3PHP &gt;=5.4

0.6PHP &gt;=7.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/285d6e97e3aae4bf76c4b005bcef72e5229802085120067f5f01eba4b8377eb5?d=identicon)[tholu](/maintainers/tholu)

---

Top Contributors

[![tholu](https://avatars.githubusercontent.com/u/316763?v=4)](https://github.com/tholu "tholu (9 commits)")[![donatj](https://avatars.githubusercontent.com/u/133747?v=4)](https://github.com/donatj "donatj (1 commits)")[![rinogo](https://avatars.githubusercontent.com/u/3732514?v=4)](https://github.com/rinogo "rinogo (1 commits)")[![RolandRosenfeld](https://avatars.githubusercontent.com/u/6381171?v=4)](https://github.com/RolandRosenfeld "RolandRosenfeld (1 commits)")

---

Tags

phpipv6ipv4cidr

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/tholu-php-cidr-match/health.svg)

```
[![Health](https://phpackages.com/badges/tholu-php-cidr-match/health.svg)](https://phpackages.com/packages/tholu-php-cidr-match)
```

###  Alternatives

[zoujingli/ip2region

ip2region v3.0 for PHP - 企业级 IP 地理位置查询库，支持 IPv4 和 IPv6，多种缓存策略，零依赖，开箱即用

1.4k475.0k67](/packages/zoujingli-ip2region)[s1lentium/iptools

PHP Library for manipulating network addresses (IPv4 and IPv6)

2446.6M28](/packages/s1lentium-iptools)[mlocati/ip-lib

Handle IPv4, IPv6 addresses and ranges

3167.3M68](/packages/mlocati-ip-lib)[jalle19/php-whitelist-check

Provides a simple way to check whether an address or domain is on a whitelist

45796.8k4](/packages/jalle19-php-whitelist-check)[markrogoyski/ipv4-subnet-calculator

Network calculator for subnet mask and other classless (CIDR) network information.

175852.6k14](/packages/markrogoyski-ipv4-subnet-calculator)[rlanvin/php-ip

IPv4/IPv6 manipulation library for PHP

180803.8k12](/packages/rlanvin-php-ip)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
