/** * Compares two versions, can be used with usort() * @param string|version $v1 The first version * @param string|version $v2 The second version * @param bool $loose * @return int 0 when they are equal, -1 ifthe second version is smaller, 1 ifthe second version is greater */ public static function compare($v1, $v2, $loose = false) { if ($v1 instanceof self) { $v1 = $v1->getVersion(); } if ($v2 instanceof self) { $v2 = $v2->getVersion(); } return G::compare($v1, $v2, $loose); }