PHPackages                             remorhaz/int-rangesets - 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. remorhaz/int-rangesets

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

remorhaz/int-rangesets
======================

Integer range sets manipulation

v0.3.0(2y ago)2157.4k↓53.7%32MITPHPPHP ~8.1.0 || ~8.2.0 || ~8.3.0CI failing

Since Apr 17Pushed 2y ago1 watchersCompare

[ Source](https://github.com/remorhaz/php-int-rangesets)[ Packagist](https://packagist.org/packages/remorhaz/int-rangesets)[ Docs](https://github.com/remorhaz/php-int-rangesets)[ RSS](/packages/remorhaz-int-rangesets/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (5)Dependencies (2)Versions (6)Used By (2)

Integer Range Sets
==================

[](#integer-range-sets)

[![Latest Stable Version](https://camo.githubusercontent.com/3323f97bc0dbdd2aafe015fbe7ccde8b839995e53ebe5f0887fe26924ec863c6/68747470733a2f2f706f7365722e707567782e6f72672f72656d6f7268617a2f696e742d72616e6765736574732f762f737461626c65)](https://packagist.org/packages/remorhaz/int-rangesets)[![Build Status](https://camo.githubusercontent.com/9a3b31cb6461aa05d36641766f38974af6bd7b5206bdd4a8f92efb9039faa4c5/68747470733a2f2f7472617669732d63692e636f6d2f72656d6f7268617a2f7068702d696e742d72616e6765736574732e7376673f6272616e63683d6d6173746572)](https://travis-ci.com/remorhaz/php-int-rangesets)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/77852cf821de48612ddfa69be89d4c899258cee78da5a88003a1905338270b4b/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f72656d6f7268617a2f7068702d696e742d72616e6765736574732f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/remorhaz/php-int-rangesets/?branch=master)[![codecov](https://camo.githubusercontent.com/eb8c60a84bd352902866de565e6661c4cfe9f684c6afb74a8774e5dbb39204ed/68747470733a2f2f636f6465636f762e696f2f67682f72656d6f7268617a2f7068702d696e742d72616e6765736574732f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/remorhaz/php-int-rangesets)[![Mutation testing badge](https://camo.githubusercontent.com/d35a7d6463f0f7115ad03214b677aea47698baff6a99170572b7b54ab57e1d0e/68747470733a2f2f696d672e736869656c64732e696f2f656e64706f696e743f7374796c653d666c61742675726c3d687474707325334125324625324662616467652d6170692e737472796b65722d6d757461746f722e696f2532466769746875622e636f6d25324672656d6f7268617a2532467068702d696e742d72616e6765736574732532466d6173746572)](https://dashboard.stryker-mutator.io/reports/github.com/remorhaz/php-int-rangesets/master)[![License](https://camo.githubusercontent.com/ced3f872e8b894c44f00b2b409b4d03b3c5a3e28877ffe57fc61ce6968fe591c/68747470733a2f2f706f7365722e707567782e6f72672f72656d6f7268617a2f696e742d72616e6765736574732f6c6963656e7365)](https://packagist.org/packages/remorhaz/int-rangesets)

This small library allows manipulating integer sets.

Requirements
============

[](#requirements)

- PHP 8.1, 8.2, 8.3.

Installation
============

[](#installation)

```
composer require remorhaz/int-rangesets
```

Usage
=====

[](#usage)

Introduction
------------

[](#introduction)

*Set* is represented in a form of collection of continuous *ranges*; each range is represented by a pair of integers denoting it's first and last values.

Range
-----

[](#range)

Range cannot be empty, but can contain only one integer; in that case it's first and last values are the same.

```
