From: [EMAIL PROTECTED]
Operating system: Windows XP SP1 Swedish
PHP version: 4.3.0
PHP Bug Type: Date/time related
Bug description: Bug in the function date("W");
<?php
for ($y = 0; $y <= 2050; $y++) {
$m = 12;
$d = 31;
$w = date("W", mktime(1, 1, 1, $m, $d, $y));
if ($w > 52) { echo "$y-$m-$d -> week: $w <br>"; }
}
?>
Will output:
4-12-31 -> week: 53
9-12-31 -> week: 53
15-12-31 -> week: 53
20-12-31 -> week: 53
26-12-31 -> week: 53
32-12-31 -> week: 53
37-12-31 -> week: 53
70-12-31 -> week: 53
76-12-31 -> week: 53
81-12-31 -> week: 53
87-12-31 -> week: 53
92-12-31 -> week: 53
98-12-31 -> week: 53
104-12-31 -> week: 53
109-12-31 -> week: 53
115-12-31 -> week: 53
120-12-31 -> week: 53
126-12-31 -> week: 53
132-12-31 -> week: 53
137-12-31 -> week: 53
1970-12-31 -> week: 53
1976-12-31 -> week: 53
1981-12-31 -> week: 53
1987-12-31 -> week: 53
1992-12-31 -> week: 53
1998-12-31 -> week: 53
2004-12-31 -> week: 53
2009-12-31 -> week: 53
2015-12-31 -> week: 53
2020-12-31 -> week: 53
2026-12-31 -> week: 53
2032-12-31 -> week: 53
2037-12-31 -> week: 53
Which is wrong because it should utput week: 1 :)
I think this information should be enough.
Good Luck :)
//Christian.
--
Edit bug report at http://bugs.php.net/?id=21717&edit=1
--
Try a CVS snapshot: http://bugs.php.net/fix.php?id=21717&r=trysnapshot
Fixed in CVS: http://bugs.php.net/fix.php?id=21717&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=21717&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=21717&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=21717&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=21717&r=support
Expected behavior: http://bugs.php.net/fix.php?id=21717&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=21717&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=21717&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=21717&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=21717&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=21717&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=21717&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=21717&r=gnused