Download the PHP package superscript/interval without Composer

On this page you can find all versions of the php package superscript/interval. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package interval

Interval Library

A PHP library for working with mathematical intervals. It provides an elegant way to create, compare, and work with intervals using standard mathematical notation.

Installation

Install the package via Composer:

Requirements

Usage

Creating Intervals

You can create intervals from string notation:

Interval Notation

The library supports four types of interval notation:

The inclusion or exclusion of the endpoints determines how comparisons behave. For example, if an interval is (1,5), calling $interval->isGreaterThan(1) will return true because 1 is not part of the interval. However, if the interval is [1,5], then $interval->isGreaterThanOrEqualTo(1) will return true since 1 is included.

Understanding this notation is crucial for interpreting comparison behavior correctly.

The library also supports unbounded intervals using empty endpoints. These are interpreted as extending to infinity:

Internally, unbounded sides are represented using PHP_INT_MIN or PHP_INT_MAX.

Interval Comparisons

Comparisons such as $interval->isGreaterThan($value) evaluate whether all values within the interval are greater than the given value. So [2,5] is greater than 1 (because every number from 2 to 5 is greater than 1), but not greater than 2 unless the interval is open on the left side (e.g., (2,5)).

Similarly, $interval->isLessThan($value) checks whether all values in the interval are less than the given value. (1,5) is less than 6, but not less than 5 unless the interval excludes 5 (e.g., (1,5) or [1,5).

This logic allows for precise control over numeric comparisons, especially when you want to reason about bounds inclusivity.

Testing

Run the test suite:

This includes:

License

MIT

About

This package is developed and maintained by Superscript.


All versions of interval with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
webmozart/assert Version ^1.11
brick/math Version ^0.12.0 || ^0.13.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package superscript/interval contains the following files

Loading the files please wait ....