PHPackages                             hiqdev/php-ip-tools - 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. hiqdev/php-ip-tools

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

hiqdev/php-ip-tools
===================

A library based on rlanvin/php-ip for IP addresses calculations

1.1.0(4y ago)55.5kMITPHPPHP &gt;=7.4

Since Sep 19Pushed 4y ago3 watchersCompare

[ Source](https://github.com/hiqdev/php-ip-tools)[ Packagist](https://packagist.org/packages/hiqdev/php-ip-tools)[ RSS](/packages/hiqdev-php-ip-tools/feed)WikiDiscussions master Synced today

READMEChangelog (2)Dependencies (6)Versions (3)Used By (0)

PHP IP tools
============

[](#php-ip-tools)

[![GitHub Actions](https://github.com/hiqdev/php-ip-tools/workflows/Tests/badge.svg)](https://github.com/hiqdev/php-ip-tools/actions)[![Infection MSI](https://camo.githubusercontent.com/e85f62547944d07c04e8dff4b139663646f1e857c5856ffd40985112de019c6e/68747470733a2f2f62616467652e737472796b65722d6d757461746f722e696f2f6769746875622e636f6d2f6869716465762f7068702d69702d746f6f6c732f6d6173746572)](https://infection.github.io)

This library provides tooling for IP address calculations based on [rlanvin/php-ip](https://github.com/rlanvin/php-ip)

### Free IP blocks calculation

[](#free-ip-blocks-calculation)

Compute the best possible aligned IP blocks within a given range, excluding the taken blocks or IP addresses.

Example:

```
$block = '192.168.0.0/24';
$taken = ['192.168.0.64/28'];

$calculator = new IpBlocksCalculator();
$free = $calculator->__invoke($block, $taken);

var_dump($free);
/*
 *  [
 *    '192.168.0.0/26',
 *    '192.168.0.80/28',
 *    '192.168.0.96/27',
 *    '192.168.0.128/25',
 *   ]
 */
```

See more examples in [IpBlocksCalculatorTest](blob/master/tests/Unit/IpBlocksCalculatorTest.php).

### IP ranges parsing

[](#ip-ranges-parsing)

Parse fuzzy IP address block definitions and unwrap it to an array:

Example:

```
IpRangeParser::fromString('192.0.2.[1,2,100-250]/24');
// ['192.0.2.1/24', '192.0.2.2/24', '192.0.2.100/24' ... '192.0.2.250/24']
```

See more examples in [IpRangeParserTest](blob/master/tests/Unit/IpRangeParseTest.php).

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 91.7% 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 ~187 days

Total

2

Last Release

1561d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/ccb75e3312d6bd454ea445ea308139fd185a4ca906ca5df21cc66e6a35de25a3?d=identicon)[SilverFire](/maintainers/SilverFire)

---

Top Contributors

[![SilverFire](https://avatars.githubusercontent.com/u/4499203?v=4)](https://github.com/SilverFire "SilverFire (11 commits)")[![tafid](https://avatars.githubusercontent.com/u/3338188?v=4)](https://github.com/tafid "tafid (1 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Type Coverage Yes

### Embed Badge

![Health badge](/badges/hiqdev-php-ip-tools/health.svg)

```
[![Health](https://phpackages.com/badges/hiqdev-php-ip-tools/health.svg)](https://phpackages.com/packages/hiqdev-php-ip-tools)
```

###  Alternatives

[composer/composer

Composer helps you declare, manage and install dependencies of PHP projects. It ensures you have the right stack everywhere.

29.5k196.2M3.1k](/packages/composer-composer)[friendsofphp/php-cs-fixer

A tool to automatically fix PHP code style

13.5k251.2M25.2k](/packages/friendsofphp-php-cs-fixer)[vlucas/phpdotenv

Loads environment variables from `.env` to `getenv()`, `$\_ENV` and `$\_SERVER` automagically.

13.5k640.2M6.3k](/packages/vlucas-phpdotenv)[helsingborg-stad/municipio

A bootstrap theme for creating municipality sites.

4028.5k10](/packages/helsingborg-stad-municipio)[civicrm/civicrm-core

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

751291.4k43](/packages/civicrm-civicrm-core)[rubix/ml

A high-level machine learning and deep learning library for the PHP language.

2.2k1.5M28](/packages/rubix-ml)

PHPackages © 2026

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