Version
class Version
Class Version
Methods
static
bool
test(
string $version,
string $constraints,
bool $strict = false,
string $defaultComparison = '=')
Test if a version matched the version contraints.
static
array
parse(
string $version = null)
Split a version into an associative array [version, major, minus, release, extra]
Details
at line 47
static
bool
test(
string $version,
string $constraints,
bool $strict = false,
string $defaultComparison = '=')
Test if a version matched the version contraints.
constraints can be simple or complex (multiple constraints separated by space) :
- "~2.1" : version 2.1.*
- "~2.1 <=2.1.4" : version 2.1.* but lower or equal to 2.1.4
- ">=2.1" : version 2.1.*, 2.2, ...
- ">2.1.1 <=2.1.5" : version greater than 2.1.1 but lower or equal than 2.1.5
- ...
at line 104
static
array
parse(
string $version = null)
Split a version into an associative array [version, major, minus, release, extra]