diff --git a/Classes/PHPExcel/Calculation/LookupRef.php b/Classes/PHPExcel/Calculation/LookupRef.php index 75e7f69ce..ba701dedb 100644 --- a/Classes/PHPExcel/Calculation/LookupRef.php +++ b/Classes/PHPExcel/Calculation/LookupRef.php @@ -671,14 +671,14 @@ public static function TRANSPOSE($matrixData) { } // function TRANSPOSE() - private static function _vlookupSort($a,$b) { - $f = array_keys($a); - $firstColumn = array_shift($f); - if (strtolower($a[$firstColumn]) == strtolower($b[$firstColumn])) { - return 0; - } - return (strtolower($a[$firstColumn]) < strtolower($b[$firstColumn])) ? -1 : 1; - } // function _vlookupSort() + private static function _vlookupSort($a,$b) { + reset($a); + $firstColumn = key($a); + if (($alower = strtolower($a[$firstColumn])) == ($blower = strtolower($b[$firstColumn]))) { + return 0; + } + return ($alower < $blower) ? -1 : 1; + } // function _vlookupSort() /**