Interval for PHP >= 5.4

dev-master / 1.0.x-dev 2014-06-18 12:21 UTC

This package is auto-updated.

Last update: 2024-05-23 07:16:19 UTC


Downloads Latest Stable Version Latest Unstable Version Code coverage Build Status License

Interval for PHP.

This project uses:


Using composer: either

$ composer create-project chdemko/interval:1.0.x-dev --dev; cd interval

or create a composer.json file containing

    "require": {
        "chdemko/interval": "1.0.x-dev"

and run

$ composer install

Create a test.php file containg

require __DIR__ . '/vendor/autoload.php';

use chdemko\Interval\Interval;

$interval = Interval::fromString('[2,3[');

echo $interval . PHP_EOL;

$interval->sup = 4;
echo $interval . PHP_EOL;

$interval->inf = - INF;
echo $interval . PHP_EOL;

if ($interval->contains(0))
	echo "0 is contained in $interval" . PHP_EOL;
	echo "0 is not contained in $interval" . PHP_EOL;

This should print

0 is contained in ]-INF,4[

See the examples folder for more information.



If you are using this project including publication in research activities, you have to cite it using (BibTeX format). You are also pleased to send me an email to