Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:10820 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 10676 invoked by uid 1010); 28 Jun 2004 14:15:47 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 10633 invoked from network); 28 Jun 2004 14:15:47 -0000 Received: from unknown (HELO sapo.pt) (212.55.154.22) by pb1.pair.com with SMTP; 28 Jun 2004 14:15:47 -0000 Received: (qmail 31581 invoked from network); 28 Jun 2004 14:15:46 -0000 Received: from unknown (HELO sapo.pt) (10.134.35.152) by relay2 with SMTP; 28 Jun 2004 14:15:46 -0000 Received: (qmail 7579 invoked from network); 28 Jun 2004 14:15:00 -0000 Received: from unknown (HELO pc07653) (nunoplopes@sapo.pt@[81.193.140.198]) (envelope-sender ) by mta2 (qmail-ldap-1.03) with SMTP for ; 28 Jun 2004 14:15:00 -0000 Message-ID: <002b01c45d1b$110de540$0100a8c0@pc07653> To: "Christian Schneider" Cc: "PHPdev" References: <001d01c459d4$4fbc5d20$0100a8c0@pc07653> <40DAC56C.2030101@cschneid.com> Date: Mon, 28 Jun 2004 15:20:29 +0100 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.1409 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409 Subject: Re: [PHP-DEV] Re: idate problems From: nlopess@php.net ("Nuno Lopes") Any news on this? Can someone apply that patch or just add some () to the idate switch/case L ? Thanks, Nuno ----- Original Message ----- > Nuno Lopes wrote: > > 1) (i)date('L') should return the same (1 if is leap year, 0 otherwise), but > > they aren't outputing the same > > echo date('L'); //1 > > echo idate('L'); //0 > > Yes, this is indeed a bug in the isleap macro (you needed to call it > with double parens), the fix is > > diff -u -r1.120 datetime.c > --- ext/standard/datetime.c 31 Mar 2004 17:57:33 -0000 1.120 > +++ ext/standard/datetime.c 24 Jun 2004 12:10:55 -0000 > @@ -64,7 +64,7 @@ > {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31} > }; > > -#define isleap(year) (((year % 4) == 0 && (year % 100) != 0) || (year % > 400)==0) > +#define isleap(year) ((((year) % 4) == 0 && ((year) % 100) != 0) || > ((year) % 400)==0) > #define YEAR_BASE 1900 > > /* {{{ proto int time(void) > > Chris