Symfony\Component\Intl\Util\Version::compare
Compares two versions with an operator.
This method is identical to , except that you can pass the number of regarded version components in the last argument $precision. Examples: Version::compare('1.2.3', '1.2.4', '==') // => false Version::compare('1.2.3', '1.2.4', '==', 2) // => true
Signature
public function compare(string
$version1,
[string
$version2 = null,
[string
$operator = null,
[integer|null
$precision = null]]] )
Parameters
$version1
— string- A version string.
$version2
— string- A version string to compare.
$operator
— string- The comparison operator.
$precision
— object- The number of components to compare. Pass
NULL to compare the versions unchanged.
Returns
- Boolean
- Whether the comparison succeeded.