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

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

innmind/ip
==========

IP addresses model

4.0.0(4mo ago)0122.5k↓27%4MITPHPPHP ~8.4CI passing

Since Jul 12Pushed 3mo ago1 watchersCompare

[ Source](https://github.com/Innmind/IP)[ Packagist](https://packagist.org/packages/innmind/ip)[ Docs](http://github.com/Innmind/IP)[ RSS](/packages/innmind-ip/feed)WikiDiscussions develop Synced 1mo ago

READMEChangelog (3)Dependencies (4)Versions (9)Used By (4)

IP
==

[](#ip)

[![CI](https://github.com/Innmind/IP/actions/workflows/ci.yml/badge.svg)](https://github.com/Innmind/IP/actions/workflows/ci.yml)[![codecov](https://camo.githubusercontent.com/874179a24cec36d5dd16317cf7478f81a379a048a6a169d4b893c9644f8f7742/68747470733a2f2f636f6465636f762e696f2f67682f696e6e6d696e642f49502f6272616e63682f646576656c6f702f67726170682f62616467652e737667)](https://codecov.io/gh/innmind/IP)[![Type Coverage](https://camo.githubusercontent.com/3990479b07d322896b3e15c42422723848f254bab2b430485813958a2f0704a2/68747470733a2f2f73686570686572642e6465762f6769746875622f696e6e6d696e642f49502f636f7665726167652e737667)](https://shepherd.dev/github/innmind/IP)

Immutable IP value objects.

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

[](#installation)

```
require innmind/ip
```

Usage
-----

[](#usage)

```
use Innmind\IP\{
    IP,
    IPv4,
    IPv6,
};
use Innmind\Immutable\{
    Maybe,
    Attempt,
};

$ipv4 = IP::v4('192.168.0.1');
$ipv6 = IP::v6('2001:db8:a0b:12f0::1');
IPv4::of('192.168.0.1'); // same as above
IPv6::of('2001:db8:a0b:12f0::1'); // same as above
IPv4::of('localhost'); // throws DomainException
IPv6::of('localhost'); // throws DomainException
IPv4::maybe('localhost'); // returns Maybe
IPv6::maybe('localhost'); // returns Maybe
IPv4::attempt('localhost'); // returns Attempt
IPv6::attempt('localhost'); // returns Attempt
```

###  Health Score

57

—

FairBetter than 98% of packages

Maintenance78

Regular maintenance activity

Popularity31

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity86

Battle-tested with a long release history

 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 ~518 days

Recently: every ~453 days

Total

7

Last Release

120d ago

Major Versions

1.0.0 → 2.0.02020-01-06

2.1.0 → 3.0.02022-02-22

3.2.0 → 4.0.02026-01-18

PHP version history (6 changes)1.0.0PHP ~7.1

2.0.0PHP ~7.4

2.1.0PHP ~7.4|~8.0

3.0.0PHP ~8.0

3.2.0PHP ~8.2

4.0.0PHP ~8.4

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/851425?v=4)[Baptiste Langlade](/maintainers/Baptouuuu)[@Baptouuuu](https://github.com/Baptouuuu)

---

Top Contributors

[![Baptouuuu](https://avatars.githubusercontent.com/u/851425?v=4)](https://github.com/Baptouuuu "Baptouuuu (52 commits)")

---

Tags

addressIP

### Embed Badge

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

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

###  Alternatives

[stevebauman/location

Retrieve a user's location by their IP Address

1.3k7.6M65](/packages/stevebauman-location)[markrogoyski/ipv4-subnet-calculator

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

177813.7k6](/packages/markrogoyski-ipv4-subnet-calculator)[s1lentium/iptools

PHP Library for manipulating network addresses (IPv4 and IPv6)

2446.2M24](/packages/s1lentium-iptools)

PHPackages © 2026

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