PHPackages                             andrewandante/submuncher - 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. andrewandante/submuncher

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

andrewandante/submuncher
========================

Tool for consolidating subnets

0.4.1(8y ago)2119[1 issues](https://github.com/andrewandante/submuncher/issues)[1 PRs](https://github.com/andrewandante/submuncher/pulls)MITPHPPHP &gt;=5.6

Since Feb 21Pushed 8y ago1 watchersCompare

[ Source](https://github.com/andrewandante/submuncher)[ Packagist](https://packagist.org/packages/andrewandante/submuncher)[ RSS](/packages/andrewandante-submuncher/feed)WikiDiscussions master Synced yesterday

READMEChangelog (9)Dependencies (3)Versions (11)Used By (0)

SubMuncher
==========

[](#submuncher)

Handy tool for consolidating subnets into as few subnets as possible

[![Scrutinizer Code Quality](https://camo.githubusercontent.com/2bccd301352ee8a22850bbb1ef747cddd881d8601572acfc7f806ea58ea0c1a8/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f616e64726577616e64616e74652f7375626d756e636865722f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/andrewandante/submuncher/?branch=master)[![Build Status](https://camo.githubusercontent.com/1ca72e3159ef3bb59fa22b51801caf0b23baafffa6cefff98cad1213cb06bb8f/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f616e64726577616e64616e74652f7375626d756e636865722f6261646765732f6275696c642e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/andrewandante/submuncher/build-status/master)

Installation
------------

[](#installation)

`composer require andrewandante/submuncher`

Using it
--------

[](#using-it)

The most basic usage is to pass an array of IPv4 addresses into `AndrewAndante\SubMuncher\SubMuncher::consolidate()`

The most useful usage is to pass an array of CIDRs into `AndrewAndante\SubMuncher\SubMuncher::consolidate_subnets()`

There are also a bunch of helper IP utility functions in the `Util` classe should you need to do some tweaking.

You can also pass a second parameter that limits the number of rules returned. This invokes some magic to combine some subnets in a way that introduces the least number of additional IP addresses into the range as possible.

For example, to reduce your list of subnets down to 25 total rules, try `AndrewAndante\SubMuncher\SubMuncher::consolidate_subnets($cidrsArray, 25);`

Debugging
---------

[](#debugging)

There are verbose methods which will give you the initial list of IPs covered by your CIDRs, and the ultimate list covered. That will give you the opportunity to compare, so you can see what additional IPs have been introduced. This is in case you are using them for a whitelist or something that requires exact knowledge of the IPs.

### Warning

[](#warning)

This is significantly slower when calculating subnets, as it expands out all the individual IPs in the subnet, rather than just using the first and last IP

Limitations
-----------

[](#limitations)

Only tested on IPv4 at present.

###  Health Score

24

—

LowBetter than 31% of packages

Maintenance10

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~4 days

Total

9

Last Release

3017d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/3b26f10a5e259d1dc81521de453f7c4899b3d0160083109dd41db751120b23f6?d=identicon)[andrewandante](/maintainers/andrewandante)

---

Top Contributors

[![andrewandante](https://avatars.githubusercontent.com/u/9702648?v=4)](https://github.com/andrewandante "andrewandante (34 commits)")

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/andrewandante-submuncher/health.svg)

```
[![Health](https://phpackages.com/badges/andrewandante-submuncher/health.svg)](https://phpackages.com/packages/andrewandante-submuncher)
```

PHPackages © 2026

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