php-extended / php-version-object
An implementation of the php-version-interface library
7.0.7
2024-12-08 14:14 UTC
Requires
- php: >=8.0
- php-extended/php-parser-lexer: ^7
- php-extended/php-version-interface: ^7
Requires (Dev)
- dev-master
- 7.0.7
- 7.0.6
- 7.0.5
- 7.0.4
- 7.0.3
- 7.0.2
- 7.0.1
- 7.0.0
- 6.1.4
- 6.1.3
- 6.1.2
- 6.1.1
- 6.1.0
- 6.0.3
- 6.0.2
- 6.0.1
- 6.0.0
- 5.0.1
- 5.0.0
- 4.3.3
- 4.3.2
- 4.3.1
- 4.3.0
- 4.2.7
- 4.2.6
- 4.2.5
- 4.2.4
- 4.2.3
- 4.2.2
- 4.2.1
- 4.2.0
- 4.1.2
- 4.1.1
- 4.1.0
- 4.0.18
- 4.0.17
- 4.0.16
- 4.0.15
- 4.0.14
- 4.0.13
- 4.0.12
- 4.0.11
- 4.0.10
- 4.0.9
- 4.0.8
- 4.0.7
- 4.0.6
- 4.0.5
- 4.0.4
- 4.0.3
- 4.0.2
- 4.0.1
- 4.0.0
- 3.1.0
- 3.0.3
- 3.0.2
- 3.0.1
- 3.0.0
- 2.0.0
- 1.0.12
- 1.0.11
- 1.0.10
- 1.0.9
- 1.0.8
- 1.0.7
- 1.0.6
- 1.0.5
- 1.0.4
- 1.0.3
- 1.0.2
- 1.0.1
- 1.0.0
This package is auto-updated.
Last update: 2024-12-08 13:16:00 UTC
README
An implementation of the php-version-interface library
Installation
The installation of this library is made via composer and the autoloading of all classes of this library is made through their autoloader.
- Download
composer.phar
from their website. - Then run the following command to install this library as dependency :
php composer.phar php-extended/php-version-object ^7
Basic Usage
You may build version numbers objects with the following code :
use PhpExtended\Version\Version;
$version = new Version(1, 0, 0, "alpha"); // 1.0.0-alpha
$version = $version->incrementPatch(); // 1.0.1
$version = $version->incrementMinor(); // 1.1.0
$version = $version->incrementMajor(); // 2.0.0
or with constraints and ranges :
use PhpExtended\PhpVersion\VersionConstraintSimple;
use PhpExtended\PhpVersion\VersionOperatorHigherEquals;
$constraint = new VersionConstraintSimple(
new VersionOperatorHigherEquals(),
new Version(2, 3, 4)
); // >=2.3.4
$range = $constraint->getRange(); // [2.3.4, +∞[
$range->containsVersion(new Version(3, 0, 0)); // true
License
MIT (See license file).