Fix multiSort create_function is deprecated in PHP 7.2

This commit is contained in:
Alex Stoica
2018-01-07 03:07:07 +00:00
parent 4c16c01781
commit 7b67bed84e
+3 -1
View File
@@ -43,8 +43,10 @@ class multiSort {
$t = 'strnatcmp($a[' . $key . '], $b[' . $key . '])';
break;
}
usort($array, create_function('$a, $b', 'return ' . ($order ? '' : '-') . '(' . $t . ');'));
usort($array, function($a, $b) use ($order, $t) {
return ($order ? '' : '-') . ($t);
});
}
return $array;
}