PHPackages                             alcamo/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. [Utility &amp; Helpers](/categories/utility)
4. /
5. alcamo/range

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

alcamo/range
============

Ranges of various types

0.1.2(2mo ago)072↑150%1Apache-2.0PHPPHP 7.3 - 8.0

Since Oct 22Pushed 2mo agoCompare

[ Source](https://github.com/rv1971/alcamo-range)[ Packagist](https://packagist.org/packages/alcamo/range)[ RSS](/packages/alcamo-range/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (3)Versions (4)Used By (1)

Usage example
=============

[](#usage-example)

```
use alcamo\range\NonNegativeRange;

$range = NonNegativeRange::newFromString('3-7');

foreach ([-1, 0, 2, 3, 5, 7, 8] as $value) {
    echo "contains $value: " . $range->contains($value) . "\n";
}

```

This will output:

```
contains -1: 0
contains 0: 0
contains 2: 0
contains 3: 1
contains 5: 1
contains 7: 1
contains 8: 0

```

Provided interfaces, traits and classes
=======================================

[](#provided-interfaces-traits-and-classes)

- The interface `RangeInterface` provides a very basic interface for ranges of any kind.
- The trait `RangeTrait` provides a simple implementation which covers most of what is needed for `RangeInterface`.
- The class `NonNegativeRange` provides an implementation of a range of nonnegative integers, potentially unbounded from above, including the bound(s).

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance83

Actively maintained with recent releases

Popularity12

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity32

Early-stage or recently created project

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

Total

3

Last Release

87d ago

### Community

Maintainers

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

---

Top Contributors

[![rv1971](https://avatars.githubusercontent.com/u/39520256?v=4)](https://github.com/rv1971 "rv1971 (2 commits)")

---

Tags

intervalrange

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

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

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

###  Alternatives

[league/period

Time range API for PHP

7335.4M21](/packages/league-period)[brick/date-time

Date and time library

3623.3M61](/packages/brick-date-time)[kartik-v/yii2-date-range

An advanced Yii 2 date range picker input for based on bootstrap-daterangepicker plugin.

894.4M42](/packages/kartik-v-yii2-date-range)[kartik-v/yii2-sortable

Create sortable lists and grids using HTML5 drag and drop API for Yii 2.0.

433.8M13](/packages/kartik-v-yii2-sortable)[kartik-v/yii2-widget-rangeinput

An enhanced Yii 2 widget encapsulating the HTML 5 range input (sub repo split from yii2-widgets)

193.9M3](/packages/kartik-v-yii2-widget-rangeinput)[kartik-v/yii2-field-range

Easily manage Yii 2 ActiveField ranges (from/to) with Bootstrap 3 addons markup and more

232.1M26](/packages/kartik-v-yii2-field-range)

PHPackages © 2026

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