php/version-id.jq

12 lines
274 B
Plaintext
Raw Normal View History

2020-08-18 07:12:07 +02:00
def version_id:
# https://www.php.net/phpversion
# $version_id = $major_version * 10000 + $minor_version * 100 + $release_version;
sub("[a-zA-Z].*$"; "")
2020-08-18 07:12:07 +02:00
| split(".")
| (
(.[0] // 0 | tonumber) * 10000
+ (.[1] // 0 | tonumber) * 100
+ (.[2] // 0 | tonumber)
)
;