Semantic versioning, often abbreviated as SemVer, is a versioning scheme for software that aims to convey meaning about the underlying changes with each new release. The core principles of Semantic versioning are defined in the format of MAJOR.MINOR.PATCH, where:
Following these principles helps developers understand the level of changes made and the impact they might have on their applications.
// Example of semantic versioning
function updateVersion($currentVersion, $type) {
list($major, $minor, $patch) = explode('.', $currentVersion);
switch($type) {
case 'major':
$major++;
$minor = 0;
$patch = 0;
break;
case 'minor':
$minor++;
$patch = 0;
break;
case 'patch':
$patch++;
break;
}
return "$major.$minor.$patch";
}
// Usage
echo updateVersion("1.4.2", "minor"); // Output: 1.5.0
How do I avoid rehashing overhead with std::set in multithreaded code?
How do I find elements with custom comparators with std::set for embedded targets?
How do I erase elements while iterating with std::set for embedded targets?
How do I provide stable iteration order with std::unordered_map for large datasets?
How do I reserve capacity ahead of time with std::unordered_map for large datasets?
How do I erase elements while iterating with std::unordered_map in multithreaded code?
How do I provide stable iteration order with std::map for embedded targets?
How do I provide stable iteration order with std::map in multithreaded code?
How do I avoid rehashing overhead with std::map in performance-sensitive code?
How do I merge two containers efficiently with std::map for embedded targets?