PHPackages                             serafim/interval - 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. serafim/interval

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

serafim/interval
================

A small library that implements the interval iterator function

31PHP

Since Apr 12Pushed 8y ago1 watchersCompare

[ Source](https://github.com/SerafimArts/Interval)[ Packagist](https://packagist.org/packages/serafim/interval)[ RSS](/packages/serafim-interval/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependenciesVersions (1)Used By (0)

Interval
========

[](#interval)

A small library that implements the interval iterator function.

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

[](#installation)

To install the package, use the [Composer](https://getcomposer.org/doc/).

```
composer require serafim/interval
```

Usage
-----

[](#usage)

### Increasing interval

[](#increasing-interval)

In the second integer argument (to) is greater than the first integer argument (from), the interval will be incremented by `1`.

```
$interval = \interval(1, 6);
// [1, 2, 3, 4, 5, 6]
```

### Decreasing interval

[](#decreasing-interval)

In the first integer argument (from) is greater than the second integer argument (to), the interval will be decremented by `-1`.

```
$interval = \interval(6, 1);
// [6, 5, 4, 3, 2, 1]
```

### Floats interval

[](#floats-interval)

If one of the values is float, the step will automatically change to `.1` (or `-.1`).

```
$incremental = \interval(.5, 1);
// [0.5, 0.6, 0.7, 0.8, 0.9, 1.0]

$decremental = \interval(1, .5);
// [1.0, 0.9, 0.8, 0.7, 0.6, 0.5]
```

### Step indication

[](#step-indication)

```
$interval = \interval(1, 1.1)->step(.05);
// [1.0, 1.05, 1.1]
```

### Infinity increasing interval

[](#infinity-increasing-interval)

```
$interval = \interval(1);
// [1, 2, 3, 4 … ∞]
```

### Infinity decreasing interval

[](#infinity-decreasing-interval)

```
$interval = \interval(2)->step(-1);
// [2, 1, 0, -1, -2 … ∞]
```

### Shortcut definition

[](#shortcut-definition)

Just a little insanity, why not? Just do not ask how it works!

```
$interval = \interval(1...5);
// [1, 2, 3, 4, 5]
```

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/150420?v=4)[Ruslan Sharipov](/maintainers/Serafim)[@serafim](https://github.com/serafim)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/serafim-interval/health.svg)

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

PHPackages © 2026

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