Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:10389 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 26433 invoked by uid 1010); 10 Jun 2004 15:16:20 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 26407 invoked from network); 10 Jun 2004 15:16:20 -0000 Received: from unknown (HELO colo.lerdorf.com) (66.198.51.121) by pb1.pair.com with SMTP; 10 Jun 2004 15:16:20 -0000 Received: from [192.168.1.101] (c-24-6-1-90.client.comcast.net [24.6.1.90]) by colo.lerdorf.com (8.12.11/8.12.11/Debian-5) with ESMTP id i5AFGIgk012902; Thu, 10 Jun 2004 08:16:19 -0700 Date: Thu, 10 Jun 2004 08:16:16 -0700 (PDT) X-X-Sender: rasmus@thinkpad.lerdorf.com To: Stefan Esser cc: internals@lists.php.net In-Reply-To: <40C879E8.8010809@php.net> Message-ID: References: <20040609150030.18f59a2c.tony2001@phpclub.net> <20040609155610.0425464f.tony2001@phpclub.net> <20040610115626.7984e4b5.tony2001@phpclub.net> <20040610093552.13990.qmail@pb1.pair.com> <40C879E8.8010809@php.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Spam-Status: No, hits=-4.9 required=5.0 tests=BAYES_00 autolearn=ham version=2.63 X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on colo Subject: Re: [PHP-DEV] stripslashes() improvements From: rasmus@php.net (Rasmus Lerdorf) 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