Skip to main content

Module phpver

Module phpver 

Source
Expand description

Exact port of PHP’s version_compare() (ext/standard/versioning.c): canonicalization (-, _, + -> ., a . inserted at every digit/non-digit transition), then component-by-component comparison; the special forms are ordered dev < alpha = a < beta = b < RC = rc < # < pl = p, a number counting as #. This is the ordering that Constraint::versionCompare, the bounds and version sorting rely on.

Functions§

canonicalize
php_canonicalize_version: the first character is copied as is, then -/_/+ and any non-alphanumeric become . (never doubled), and a . is inserted at every digit <-> non-digit transition.
version_compare
version_compare($a, $b): -1 / 0 / 1.
version_compare_op
version_compare($a, $b, $op).