From: andy at needcheats dot com
Operating system: WinXP SP2
PHP version: 5.2.2
PHP Bug Type: Date/time related
Bug description: Month order output wrong
Description:
------------
I am getting an incorrect output of a list of months.
Starts with December instead of January!
**NOT** having same problem with Days and Years using the same loop
method!
Reproduce code:
---------------
$now = date('n');
for($i = 1; $i <= 12; $i++)
{
$month = date("F", mktime(0, 0, 0, $i, 0, 0));
$value = date("m", mktime(0, 0, 0, $i, 0, 0));
echo $i.'-'.$value.'-'.$month.'<br/>';
}
Expected result:
----------------
The loop should output the following:
1-01-January
2-02-February
3-03-March
4-04-April
5-05-May
6-06-June
7-07-July
8-08-August
9-09-September
10-10-October
11-11-November
12-12-December
Actual result:
--------------
Following unexpected result is produced:
1-12-December
2-01-January
3-02-February
4-03-March
5-04-April
6-05-May
7-06-June
8-07-July
9-08-August
10-09-September
11-10-October
12-11-November
--
Edit bug report at http://bugs.php.net/?id=41386&edit=1
--
Try a CVS snapshot (PHP 4.4):
http://bugs.php.net/fix.php?id=41386&r=trysnapshot44
Try a CVS snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=41386&r=trysnapshot52
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=41386&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=41386&r=fixedcvs
Fixed in release:
http://bugs.php.net/fix.php?id=41386&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=41386&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=41386&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=41386&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=41386&r=support
Expected behavior: http://bugs.php.net/fix.php?id=41386&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=41386&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=41386&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=41386&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=41386&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=41386&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=41386&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=41386&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=41386&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=41386&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=41386&r=mysqlcfg