Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:27182 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 33612 invoked by uid 1010); 22 Dec 2006 15:29:31 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 33597 invoked from network); 22 Dec 2006 15:29:31 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 22 Dec 2006 15:29:31 -0000 Authentication-Results: pb1.pair.com header.from=iliaal@gmail.com; sender-id=pass; domainkeys=good Authentication-Results: pb1.pair.com smtp.mail=iliaal@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 64.233.162.231 as permitted sender) DomainKey-Status: good X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: iliaal@gmail.com X-Host-Fingerprint: 64.233.162.231 nz-out-0506.google.com Linux 2.4/2.6 Received: from [64.233.162.231] ([64.233.162.231:38935] helo=nz-out-0506.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 4E/E1-17044-599FB854 for ; Fri, 22 Dec 2006 10:28:56 -0500 Received: by nz-out-0506.google.com with SMTP id k1so1379963nzf for ; Fri, 22 Dec 2006 07:28:19 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:in-reply-to:references:mime-version:x-priority:content-type:message-id:cc:content-transfer-encoding:from:subject:date:to:x-mailer:sender; b=rsSVEZpJSZtwyFGWPPihyWR+Gd0nC1/jT+vheOlU2NZIGwpSmcN5FXXBhvZauUZ9EixkNKYbn8iJPlZ5APX6O8exygUSn+NYrnnipj+gwBpArXIEBWyMTnG+3H82yqGO4rRcmy1XmkBAt8hQApLqHvnkjYY/x/DwKA29AGGjWFQ= Received: by 10.65.192.16 with SMTP id u16mr1081094qbp.1166801298185; Fri, 22 Dec 2006 07:28:18 -0800 (PST) Received: from ?192.168.1.6? ( [74.108.69.82]) by mx.google.com with ESMTP id e17sm19666513qba.2006.12.22.07.28.17; Fri, 22 Dec 2006 07:28:17 -0800 (PST) In-Reply-To: <023001c725dc$bb9b04c0$0201a8c0@pc1> References: <00a901c72586$f7e7afb0$0201a8c0@pc1> <043EF248-A4B4-438F-B738-834A5770A2D9@prohost.org> <023001c725dc$bb9b04c0$0201a8c0@pc1> Mime-Version: 1.0 (Apple Message framework v752.3) X-Priority: 3 Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-ID: <3613E3D1-E072-41D7-9E8A-870A26E1F5AD@prohost.org> Cc: Content-Transfer-Encoding: 7bit Date: Fri, 22 Dec 2006 10:28:15 -0500 To: Matt Wilmas X-Mailer: Apple Mail (2.752.3) Sender: Ilia Alshanetsky Subject: Re: [PHP-DEV] [PATCH] Small date() optimization From: ilia@prohost.org (Ilia Alshanetsky) I think this is actually a desired behavior, I do not want to change how the existing code works in patch level release. Otherwise the patch is fine and I've already applied it to the CVS. On 22-Dec-06, at 10:20 AM, Matt Wilmas wrote: > Hi Ilia, > > Oh I know that. :-) I'm just talking about if there's a backslash > as the > last character. For example, date('U\\') (U\ passed after script > parsing), > the backslash is gone, which doesn't seem correct... (Actually, it > "appends" the '\0'.) > > > Matt > > > ----- Original Message ----- > From: "Ilia Alshanetsky" > Sent: Friday, December 22, 2006 > >> Matt, >> >> The backslash removal is actually intentional. It is designed to >> handle instances such as "\d", in which case the format value is >> printed as a literal "d". >> >> >> On 22-Dec-06, at 12:06 AM, Matt Wilmas wrote: >> >>> Hi, >>> >>> Just a simple patch for 5.2 to save smart_str_appends()'s strlen() >>> calls in >>> date_format(). It's already done in HEAD. Seems pretty safe for >>> 5.2.1. :-) >>> >>> I also noticed that if the format string contains a backslash as >>> the last >>> character, it is lost (should be printed right?). So I changed >>> that too and >>> attached the patch for HEAD. >>> >>> 5.2's patch: >>> http://realplain.com/php/date_optimization_5_2.diff >>> >>> >>> Matt >> >> Ilia Alshanetsky > > Ilia Alshanetsky