Universeorange.com/Docs/
{string.compare.version(String $version1, String $version2, String $operator=null)}
Compares two "PHP-standardized" version number strings.
{string.compare.version()} compares two "PHP-standardized" version number strings.
The function first replaces _, - and + with a dot . in the version strings and also inserts dots . before and after any non number so that for example '4.3.2RC1' becomes '4.3.2.RC.1'.
Then it compares the parts starting from left to right.
If a part contains special version strings these are handled in the following order: any string not found in this list < dev < alpha = a < beta = b < RC = rc < # < pl = p.
This way not only versions with different levels like '4.1' and '4.1.2' can be compared but also any PHP specific version containing development state.
If the third optional operator argument is specified, test for a particular relationship.
The possible operators are: <, lt, <=, le, >, gt, >=, ge, ==, =, eq, !=, <>, ne respectively.
By default,
{string.compare.version()}returns-1if the first version is lower than the second,0if they are equal, and1if the second is lower.
When using the optional operator argument, the function will returntrueif the relationship is the one specified by the operator,falseotherwise.
If an unsupported operator is given,nullis returned.
https://www.php.net/manual/en/function.version-compare.php
Last modified: 2021-06-06
© 2021 universeorange.com