Re: Re: idate problems
| From: | Nuno Lopes | Date: | Mon, 28 Jun 2004 14:20:29 +0000 |
| Subject: | Re: Re: idate problems | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-10820@lists.php.net to get a copy of this message | ||
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