From 7b67bed84e32523295f99d765e4e5a45038c1468 Mon Sep 17 00:00:00 2001 From: Alex Stoica <0x01.alex@gmail.com> Date: Sun, 7 Jan 2018 03:07:07 +0000 Subject: [PATCH] Fix multiSort create_function is deprecated in PHP 7.2 --- GameEngine/Multisort.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/GameEngine/Multisort.php b/GameEngine/Multisort.php index 97b03d19..8935c470 100755 --- a/GameEngine/Multisort.php +++ b/GameEngine/Multisort.php @@ -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; }