chdemko / interval
Interval for PHP >= 5.4
dev-master / 1.0.x-dev
2014-06-18 12:21 UTC
Requires
- php: >=5.4.0
Requires (Dev)
- phpdocumentor/phpdocumentor: 2.5.*@dev
- satooshi/php-coveralls: dev-master
This package is auto-updated.
Last update: 2024-12-23 08:37:38 UTC
README
Interval for PHP.
This project uses:
- PHP Code Sniffer for checking PHP code style using Joomla Coding Standards
- PHPUnit for unit test (100% covered)
- phpDocumentor for api documentation
Installation
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
<?php 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; } else { echo "0 is not contained in $interval" . PHP_EOL; }
This should print
[2,3[
[2,4[
]-INF,4[
0 is contained in ]-INF,4[
See the examples folder for more information.
Documentation
Citation
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 chdemko@gmail.com.
- authors: Christophe Demko
- title: php-interval: a PHP library for handling intervals
- year: 2014
- how published: http://chdemko.github.io/php-interval