src/Str.php
protected static function mbStrReplaceCaller(
        $search,
        $replace,
        $subject,
        $caseInsensitive = false,
        $encoding = self::DEFAULT_ENCODING,
        &$count = null
    ) {
        if (is_array($subject)) {
            $result = [];
            foreach ($subject as $item) {
                $result[] = static::mbStrReplaceCaller($search, $replace, $item, $caseInsensitive, $encoding, $count);
            }

            return $result;
        }

        if (!is_array($search)) {
            return static::mbStrReplaceInternal($search, $replace, $subject, $caseInsensitive, $encoding, $count);
        }

        $replaceIsArray = is_array($replace);
        foreach ($search as $key => $value) {
            $subject = static::mbStrReplaceInternal(
                $value,
                ($replaceIsArray ? $replace[$key] : $replace),
                $subject,
                $caseInsensitive,
                $encoding,
                $count
            );
        }

        return $subject;
    }
protected static function mbStrReplaceCaller(
        $search,
        $replace,
        $subject,
        $caseInsensitive = false,
        $encoding = self::DEFAULT_ENCODING,
        &$count = null
    ) {
        if (is_array($subject)) {
            $result = [];
            foreach ($subject as $item) {
                $result[] = static::mbStrReplaceCaller($search, $replace, $item, $caseInsensitive, $encoding, $count);
            }

            return $result;
        }

        if (!is_array($search)) {
            return static::mbStrReplaceInternal($search, $replace, $subject, $caseInsensitive, $encoding, $count);
        }

        $replaceIsArray = is_array($replace);
        foreach ($search as $key => $value) {
            $subject = static::mbStrReplaceInternal(
                $value,
                ($replaceIsArray ? $replace[$key] : $replace),
                $subject,
                $caseInsensitive,
                $encoding,
                $count
            );
        }

        return $subject;
    }
protected static function mbStrReplaceCaller ( $ search , $ replace , $ subject , $ caseInsensitive = false , $ encoding = self :: DEFAULT_ENCODING , & $ count = null ) { if ( is_array ( $ subject ) ) { $ result = [ ] ; foreach ( $ subject as $ item ) { $ result [ ] = static :: mbStrReplaceCaller ( $ search , $ replace , $ item , $ caseInsensitive , $ encoding , $ count ) ; } return $ result ; } if ( ! is_array ( $ search ) ) { return static :: mbStrReplaceInternal ( $ search , $ replace , $ subject , $ caseInsensitive , $ encoding , $ count ) ; } $ replaceIsArray = is_array ( $ replace ) ; foreach ( $ search as $ key => $ value ) { $ subject = static :: mbStrReplaceInternal ( $ value , ( $ replaceIsArray ? $ replace [ $ key ] : $ replace ) , $ subject , $ caseInsensitive , $ encoding , $ count ) ; } return $ subject ; }
Replaces a substring inside a string with multi-byte support

@param string|array $search
@param string|array $replace
@param string|array $subject
@param bool         $caseInsensitive
@param string       $encoding
@param int          $count

@return array|string
@see     https://github.com/faceleg/php-mb_str_replace
@SuppressWarnings(PHPMD.BooleanArgumentFlag)
Replaces a substring inside a string with multi - byte support