From: Matthias Schmidt Date: Wed, 3 Aug 2011 15:29:03 +0000 (+0200) Subject: Removed ArrayUtil::intersectKeys() X-Git-Tag: 2.0.0_Beta_1~1916^2~2 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=548141d9e861ad337b256e160cd9b3b8c1523b81;p=GitHub%2FWoltLab%2FWCF.git Removed ArrayUtil::intersectKeys() `array_intersect_key()` is available as of PHP 5.1.0. --- diff --git a/wcfsetup/install/files/lib/util/ArrayUtil.class.php b/wcfsetup/install/files/lib/util/ArrayUtil.class.php index 7ad7ab9d3c..c99256734c 100644 --- a/wcfsetup/install/files/lib/util/ArrayUtil.class.php +++ b/wcfsetup/install/files/lib/util/ArrayUtil.class.php @@ -102,34 +102,6 @@ class ArrayUtil { return $array; } - /** - * Computes the intersection of arrays using keys for comparison - * Alias to php array_intersect_key() function - * - * @param array $array1 The array with master keys to check. - * @param array $array2 An array to compare keys against. - * @return Returns an associative array containing all the values of array1 which have matching keys that are present in all arguments. - * @see array_intersect_key - */ - public static function intersectKeys($array1, $array2) { - if (!function_exists('array_intersect_key')) { - $numberOfArguments = func_num_args(); - for ($i = 1; !empty($array1) && $i < $numberOfArguments; $i++) { - $currentArray = func_get_arg($i); - foreach (array_keys($array1) as $key) { - if (!isset($currentArray[$key])) { - unset($array1[$key]); - } - } - } - return $array1; - } - else { - $parameters = func_get_args(); - return call_user_func_array('array_intersect_key', $parameters); - } - } - /** * Converts dos to unix newlines. *