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).