php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #35235 mktime() difference between 4.3.11 and 5.1.0RC5-dev
Submitted: 2005-11-16 11:04 UTC Modified: 2005-11-16 11:09 UTC
From: perrick at onpk dot net Assigned:
Status: Not a bug Package: Date/time related
PHP Version: 5.1.0RC4 OS: windows 2000
Private report: No CVE-ID: None
 [2005-11-16 11:04 UTC] perrick at onpk dot net
Description:
------------
While running my unit tests, I found a regression bug between version 4.3.11 and 5.1.0RC5-dev in the mktime function.

Reproduce code:
---------------
echo mktime(0, 0, 0, 0, 0, 1990)." -- ".mktime(0, 0, 0, 0, 0, -10);


Expected result:
----------------
I would have tought the result should have been consistent.

Actual result:
--------------
in PHP 4.3.11, the result is :
628383600 -- 628383600

in PHP 5.1.0RC5-dev, the result is :
628383600 -- false


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-11-16 11:09 UTC] derick@php.net
The old behavior is a bug, the new one is according to our documentation (http://php.net/mktime):

year

    The number of the year, may be a two or four digit value, with values between 0-69 mapping to 2000-2069 and 70-100 to 1970-2000. On systems where time_t is a 32bit signed integer, as most common today, the valid range for year is somewhere between 1901 and 2038, although this limitation is overcome as of PHP 5.1.0. 
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Wed Jun 03 02:00:01 2026 UTC