Re: stripslashes() improvements
| From: | Rasmus Lerdorf | Date: | Thu, 10 Jun 2004 15:16:16 +0000 |
| Subject: | Re: stripslashes() improvements | ||
| References: | 1 2 3 4 5 6 7 8 9 10 11 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-10389@lists.php.net to get a copy of this message | ||
On Thu, 10 Jun 2004, Stefan Esser wrote:
> this is not directly releated. I looked into addslashes yesterday and
> thought that it would be much better to scan the string 2 times. The
> first time to find out how much extra bytes one needs, and the second
> time to do the actual replacing. So we do not need to allocate and
> oversized block and do not need any kind of realloc. This realloc is an
> absolute performance killer.
Yeah, that's a good idea.
-Rasmus