Re: [PHP-DEV] addslashes' speed From: Sascha Schumann (sas <email protected>)
Date: 12/20/98

On Sun, 20 Dec 1998, Rasmus Lerdorf wrote:

> > Due to the massive use of macros, redundant code could be avoided kicking
> > out just another source of errors. While retaining compatibility for the
> > user, msql.c became shorter and more advanced. And PHPLIB can support
> > mSQL officially with PHP 3.0.6 ;-)
>
> Aha.. I was wondering what the motivation was. Ok, we'll stick it in
> 3.0.6, but please keep a close eye on the bug database and jump in if you
> see any reports that might be related to any of these changes. Looking at
> it closer the changes weren't as large as I thought initially.

It was much to type anyway.

> I also tested your addslashes() change. I don't quite see the advertised
> 30% speedup. Closer to 18% on my box here, but still good.

I'll commit it soon. I'm currently doing some final tests with str2str()

/* {{{ proto string str2str(string haystack, string needle, string str)
   Replaces all occurences of needle in haystack with str */

It's especially interesting since it's binary safe, e.g. replacing all NUL
bytes in /vmlinuz is no problem. The only problem while implementing it
was that erealloc(a,b) didn't return a or 0, but a different value.

          Regards,
                                                                                
                            Sascha Schumann |
                                 Consultant | finger sas <email protected>
                                            | for PGP public key

--
PHP Development Mailing List   http://www.php.net/
To unsubscribe send an empty message to php-dev-unsubscribe <email protected>
For help: php-dev-help <email protected>