Fixed memoization for strings. (sort ($a and $b) variables should be ignored) (-Mstr, -Mall)