On Sun, 9 Sep 2001, Derick Rethans wrote:

> Hello,
>
> the proto for str_replace shows this:
>
> /* {{{ proto mixed str_replace(mixed search, mixed replace, mixed subject [, bool 
>boyer])
>    Replaces all occurrences of search in haystack with replace */
>
> What is that "boyer" parameter doing there? It seems that it selects a
> different algorithm for str_replace, but what is the difference?
>

    m = pattern length
    n = string length

    Boyer-Moore is a faster algorithm, especially for larger strings
    (O(m + partial) + O(mn), best performance is O(n / m)).  I see no
    reason why this can't be merged as the default argument, but I'm
    sure sascha had a reason.  sascha? :)

    -Sterling


-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to