\Hazaar
Version
The version class

Handy for comparing version numbers such as 1.0 vs 1.3 or even 2.3.6 vs 1.6.3.7.32

Tags

Module

core

Summary
Methods Properties Constants
get
No constants
Properties
$version
$version
Methods
__construct()
__construct($version)
Version constructor.

Tags

Throws

\Exception

Parameters

$version

No description

__tostring()
__tostring() : string
Magic method to output the version as a string

Returns

string
compareTo()
compareTo($that) : int
Compare the version to another version.

Returns an integer indicating the result:

  • 0 Indicates the versions are equal.
  • -1 Means the vesion is less than $that.
  • 1 Means the version is greater than $that.

Parameters

$thatmixed

The version to compare against. Can be either a version string or another version object.

Returns

int

Either -1, 0 or 1 to indicate if the version is less than, equal to or greater than $that.

equals()
equals($that) : bool
Compares two versions to see if they are equal.

Parameters

$that

No description

Returns

\Hazaar\bool

TRUE or FALSE indicating if the versions are equal.

get()
get()