Vendor/phpspreadsheet/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Calculation.php
private static function translateFormula(array $from, array $to, $formula, $fromSeparator, $toSeparator)
    {
        //    Convert any Excel function names to the required language
        if (self::$localeLanguage !== 'en_us') {
            $inBraces = false;
            //    If there is the possibility of braces within a quoted string, then we don't treat those as matrix indicators
            if (strpos($formula, '"') !== false) {
                //    So instead we skip replacing in any quoted strings by only replacing in every other array element after we've exploded
                //        the formula
                $temp = explode('"', $formula);
                $i = false;
                foreach ($temp as &$value) {
                    //    Only count/replace in alternating array entries
                    if ($i = !$i) {
                        $value = preg_replace($from, $to, $value);
                        $value = self::translateSeparator($fromSeparator, $toSeparator, $value, $inBraces);
                    }
                }
                unset($value);
                //    Then rebuild the formula string
                $formula = implode('"', $temp);
            } else {
                //    If there's no quoted strings, then we do a simple count/replace
                $formula = preg_replace($from, $to, $formula);
                $formula = self::translateSeparator($fromSeparator, $toSeparator, $formula, $inBraces);
            }
        }

        return $formula;
    }
private static function translateFormula(array $from, array $to, $formula, $fromSeparator, $toSeparator)
    {
        //    Convert any Excel function names to the required language
        if (self::$localeLanguage !== 'en_us') {
            $inBraces = false;
            //    If there is the possibility of braces within a quoted string, then we don't treat those as matrix indicators
            if (strpos($formula, '"') !== false) {
                //    So instead we skip replacing in any quoted strings by only replacing in every other array element after we've exploded
                //        the formula
                $temp = explode('"', $formula);
                $i = false;
                foreach ($temp as &$value) {
                    //    Only count/replace in alternating array entries
                    if ($i = !$i) {
                        $value = preg_replace($from, $to, $value);
                        $value = self::translateSeparator($fromSeparator, $toSeparator, $value, $inBraces);
                    }
                }
                unset($value);
                //    Then rebuild the formula string
                $formula = implode('"', $temp);
            } else {
                //    If there's no quoted strings, then we do a simple count/replace
                $formula = preg_replace($from, $to, $formula);
                $formula = self::translateSeparator($fromSeparator, $toSeparator, $formula, $inBraces);
            }
        }

        return $formula;
    }
private static function translateFormula ( array $ from , array $ to , $ formula , $ fromSeparator , $ toSeparator ) { //    Convert any Excel function names to the required language if ( self :: $ localeLanguage !== 'en_us' ) { $ inBraces = false ; //    If there is the possibility of braces within a quoted string, then we don't treat those as matrix indicators if ( strpos ( $ formula , '"' ) !== false ) { //    So instead we skip replacing in any quoted strings by only replacing in every other array element after we've exploded //        the formula $ temp = explode ( '"' , $ formula ) ; $ i = false ; foreach ( $ temp as & $ value ) { //    Only count/replace in alternating array entries if ( $ i = ! $ i ) { $ value = preg_replace ( $ from , $ to , $ value ) ; $ value = self :: translateSeparator ( $ fromSeparator , $ toSeparator , $ value , $ inBraces ) ; } } unset ( $ value ) ; //    Then rebuild the formula string $ formula = implode ( '"' , $ temp ) ; } else { //    If there's no quoted strings, then we do a simple count/replace $ formula = preg_replace ( $ from , $ to , $ formula ) ; $ formula = self :: translateSeparator ( $ fromSeparator , $ toSeparator , $ formula , $ inBraces ) ; } } return $ formula ; }
@param string[] $from
@param string[] $to
@param string $formula
@param string $fromSeparator
@param string $toSeparator

@return string
@param string [] $from @param string [] $to @param string $formula @param string $fromSeparator @param string $toSeparator