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

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

rlanvin/php-ip
==============

IPv4/IPv6 manipulation library for PHP

v3.0.0(4y ago)179782.2k↓52.3%26[9 issues](https://github.com/rlanvin/php-ip/issues)[3 PRs](https://github.com/rlanvin/php-ip/pulls)11MITPHPPHP &gt;=7.1CI failing

Since Apr 24Pushed 4y ago14 watchersCompare

[ Source](https://github.com/rlanvin/php-ip)[ Packagist](https://packagist.org/packages/rlanvin/php-ip)[ Docs](https://github.com/rlanvin/php-ip)[ RSS](/packages/rlanvin-php-ip/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (8)Dependencies (1)Versions (13)Used By (11)

PHP IP Library
==============

[](#php-ip-library)

IPv4/IPv6 manipulation library for PHP inspired by Python [ipaddress](https://docs.python.org/dev/library/ipaddress.html).

[![Build status](https://github.com/rlanvin/php-ip/workflows/Tests/badge.svg)](https://github.com/rlanvin/php-ip/actions)[![Latest Stable Version](https://camo.githubusercontent.com/b644f99a691366b7e95fe03301dc2b6d2bede38f95a3ee2bc17324a56d1568df/68747470733a2f2f706f7365722e707567782e6f72672f726c616e76696e2f7068702d69702f762f737461626c65)](https://packagist.org/packages/rlanvin/php-ip)[![Total Downloads](https://camo.githubusercontent.com/03c990cf287fc28c98eeb49e4a3df4dbd9c1e0c04170a08bbd75d40f5a915775/68747470733a2f2f706f7365722e707567782e6f72672f726c616e76696e2f7068702d69702f646f776e6c6f616473)](https://packagist.org/packages/rlanvin/php-ip)

Requirements
------------

[](#requirements)

- PHP &gt;= 7.1
- IPv6 support enabled
- GMP extension ([www.php.net/manual/en/book.gmp.php](http://www.php.net/manual/en/book.gmp.php))

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

[](#installation)

The recommended way is to install the lib [through Composer](http://getcomposer.org/).

Simply run `composer require rlanvin/php-ip` for it to be automatically installed and included in your `composer.json`.

Now you can use the autoloader, and you will have access to the library:

```
require 'vendor/autoload.php';
```

Documentation
-------------

[](#documentation)

Complete doc is available in [the wiki](https://github.com/rlanvin/php-ip/wiki).

Contribution
------------

[](#contribution)

Feel free to contribute! Just create a new issue or a new pull request.

License
-------

[](#license)

This library is released under the MIT License.

###  Health Score

46

—

FairBetter than 92% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity56

Moderate usage in the ecosystem

Community31

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 51.9% 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 ~318 days

Recently: every ~121 days

Total

10

Last Release

1560d ago

Major Versions

v1.0.1 → v2.0.0-rc12019-01-15

v2.1.0 → v3.0.0-rc12021-04-18

PHP version history (4 changes)v1.0.0PHP &gt;=5.3.0

v2.0.0-rc1PHP ~7.0

v3.0.0-rc1PHP &gt;=7.0

v3.0.0PHP &gt;=7.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/244b4ba7915b07666db1347123ec2b322413cec2e6fd1ef81545def0dcdf82e9?d=identicon)[rlanvin](/maintainers/rlanvin)

---

Top Contributors

[![rlanvin](https://avatars.githubusercontent.com/u/1701590?v=4)](https://github.com/rlanvin "rlanvin (41 commits)")[![samuelwilliams](https://avatars.githubusercontent.com/u/806430?v=4)](https://github.com/samuelwilliams "samuelwilliams (32 commits)")[![haegar](https://avatars.githubusercontent.com/u/144081?v=4)](https://github.com/haegar "haegar (2 commits)")[![3h-mitsuchi](https://avatars.githubusercontent.com/u/159401448?v=4)](https://github.com/3h-mitsuchi "3h-mitsuchi (1 commits)")[![macmon](https://avatars.githubusercontent.com/u/7994753?v=4)](https://github.com/macmon "macmon (1 commits)")[![bkuebler](https://avatars.githubusercontent.com/u/3285957?v=4)](https://github.com/bkuebler "bkuebler (1 commits)")[![acelaya](https://avatars.githubusercontent.com/u/2719332?v=4)](https://github.com/acelaya "acelaya (1 commits)")

---

Tags

ipv6IPipv4

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[zoujingli/ip2region

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

1.4k462.5k65](/packages/zoujingli-ip2region)[mlocati/ip-lib

Handle IPv4, IPv6 addresses and ranges

3127.0M58](/packages/mlocati-ip-lib)[s1lentium/iptools

PHP Library for manipulating network addresses (IPv4 and IPv6)

2326.5M27](/packages/s1lentium-iptools)[longman/ip-tools

PHP IP Tools for manipulation with IPv4 and IPv6

149253.5k7](/packages/longman-ip-tools)[markrogoyski/ipv4-subnet-calculator

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

177839.3k13](/packages/markrogoyski-ipv4-subnet-calculator)[lifo/ip

IP address helper PHP library for working with IPv4 and IPv6 addresses

1997.4k1](/packages/lifo-ip)

PHPackages © 2026

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