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(2mo ago)37211.1k—6.7%10MITPHPPHP &gt;=7.4CI passing

Since Jul 7Pushed 2mo 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 1mo 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

55

—

FairBetter than 98% of packages

Maintenance85

Actively maintained with recent releases

Popularity46

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

77d 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

[s1lentium/iptools

PHP Library for manipulating network addresses (IPv4 and IPv6)

2446.2M24](/packages/s1lentium-iptools)[jalle19/php-whitelist-check

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

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

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

177813.7k6](/packages/markrogoyski-ipv4-subnet-calculator)[rlanvin/php-ip

IPv4/IPv6 manipulation library for PHP

180738.8k11](/packages/rlanvin-php-ip)[jaaulde/php-ipv4

PHP classes for working with IPV4 addresses and networks.

1034.6k](/packages/jaaulde-php-ipv4)

PHPackages © 2026

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