PHPackages                             maxlzp/range - 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. maxlzp/range

ActiveLibrary

maxlzp/range
============

Range to be used instead of pair of values

02PHPCI failing

Since Feb 5Pushed 5y ago1 watchersCompare

[ Source](https://github.com/MaxLZp/RangePhp)[ Packagist](https://packagist.org/packages/maxlzp/range)[ RSS](/packages/maxlzp-range/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

Range (aka Interval)
====================

[](#range-aka-interval)

May be used instead of pair of values. [More about interval](https://en.wikipedia.org/wiki/Interval_%28mathematics%29)

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

[](#installation)

Use composer

```
composer require maxlzp/range
```

Usage
-----

[](#usage)

- [Create range](#Create-range)
- [Retrieve range margins](#Retrieve-range-margins)
- [Some features](#Some-features)

##### Create range

[](#create-range)

```
$range = Range::between($start, $end);
$range = Range::betweenOpen($start, $end);
$range = Range::betweenLeftOpen($start, $end);
$range = Range::betweenRightOpen($start, $end);
$range = Range::greaterThan($value);
$range = Range::greaterOrEqualThan($value);
$range = Range::lessThan($value);
$range = Range::lessOrEqualThan($value);
```

##### Retrieve range properties

[](#retrieve-range-properties)

```
$left = $range->getLeft();
$right = $range->getRight();
$isEmpty = $range->isEmpty();
$width = $range->getWidth();
```

##### Some features

[](#some-features)

```
$gap = $range->gap($otherRange); //Gap between two ranges
$includes = $range->includes($otherRange); //Check if the range includes other range completely
$includesValue = $range->includesValue($value); //Check if the value lays within the range
$split = $range->splitAt($value); //Split the range into two ranges
$touches = $range->touches($otherRange); //Check if ranges are touching one another
```

###  Health Score

15

—

LowBetter than 5% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity2

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity30

Early-stage or recently created project

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/637671282fa7fcafa3bb41294386cf8f31e367dbd81e4ccd9256325e05d23b9c?d=identicon)[MaxLZp](/maintainers/MaxLZp)

### Embed Badge

![Health badge](/badges/maxlzp-range/health.svg)

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

PHPackages © 2026

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