This commit is contained in:
2021-11-03 16:06:33 +08:00
parent 2add330382
commit b969c86f7c
53 changed files with 256 additions and 2430 deletions
+23
View File
@@ -0,0 +1,23 @@
<?php
function version($oldVersion, $newVersion): bool
{
$first = explode('.', $oldVersion);
$end = explode('.', $newVersion);
while (count($first) > 0) {
$shift = (int)array_shift($first);
$endShift = (int)array_shift($end);
if ($endShift == $shift) {
continue;
}
if ($endShift < $shift) {
return true;
} else {
return false;
}
}
return false;
}
var_dump(version('1.4.4','1.4.3'));