Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:27181 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 31596 invoked by uid 1010); 22 Dec 2006 15:21:14 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 31581 invoked from network); 22 Dec 2006 15:21:14 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 22 Dec 2006 15:21:14 -0000 Authentication-Results: pb1.pair.com header.from=php_lists@realplain.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=php_lists@realplain.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain realplain.com from 209.142.136.132 cause and error) X-PHP-List-Original-Sender: php_lists@realplain.com X-Host-Fingerprint: 209.142.136.132 msa2-mx.centurytel.net Linux 2.4/2.6 Received: from [209.142.136.132] ([209.142.136.132:50632] helo=msa2-mx.centurytel.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id B4/91-17044-7C7FB854 for ; Fri, 22 Dec 2006 10:21:14 -0500 Received: from pc1 (d35-28.rt-bras.wnvl.centurytel.net [69.179.162.28]) by msa2-mx.centurytel.net (8.13.6/8.13.6) with SMTP id kBMFKXhe017951; Fri, 22 Dec 2006 09:20:34 -0600 Message-ID: <023001c725dc$bb9b04c0$0201a8c0@pc1> To: , "Ilia Alshanetsky" References: <00a901c72586$f7e7afb0$0201a8c0@pc1> <043EF248-A4B4-438F-B738-834A5770A2D9@prohost.org> Date: Fri, 22 Dec 2006 09:20:34 -0600 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1807 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1896 Subject: Re: [PHP-DEV] [PATCH] Small date() optimization From: php_lists@realplain.com ("Matt Wilmas") 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