php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #72457 change in strtotime for invalid dates since 5.1.0
Submitted: 2016-06-20 09:28 UTC Modified: 2016-06-20 19:24 UTC
From: patrick at bigbridge dot nl Assigned: cmb (profile)
Status: Closed Package: Documentation problem
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
 [2016-06-20 09:28 UTC] patrick at bigbridge dot nl
Description:
------------
---
From manual page: http://www.php.net/function.strtotime
---
Since 5.1.0, a date containing a day >= 32 is no longer interpreted as overflowing to the next month. Day = 31 is still accepted for months that have 30 days or less, and is interpreted as day 1 of the next month.

Test script:
---------------
echo date('Y-m-d', strtotime('2016-04-31'));
echo date('Y-m-d', strtotime('2016-05-32'));

First case returns 2016-05-01, in all PHP versions.
Second case returns 2016-06-01, before 5.1.0, and 1970-01-01 after 5.1.0.



Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-06-20 13:25 UTC] cmb@php.net
-Status: Open +Status: Verified -Assigned To: +Assigned To: cmb
 [2016-06-20 13:25 UTC] cmb@php.net
Confirmed: <https://3v4l.org/Xi2J0>.
 [2016-06-20 19:24 UTC] cmb@php.net
Automatic comment from SVN on behalf of cmb
Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=339429
Log: Fix #72457: change in strtotime for invalid dates since 5.1.0
 [2016-06-20 19:24 UTC] cmb@php.net
-Status: Verified +Status: Closed
 [2016-06-20 19:24 UTC] cmb@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.
 [2020-02-07 06:07 UTC] phpdocbot@php.net
Automatic comment on behalf of cmb
Revision: http://git.php.net/?p=doc/en.git;a=commit;h=cf0ced50ae1442186f2d9d17777bb667c1b65edf
Log: Fix #72457: change in strtotime for invalid dates since 5.1.0
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Sat Oct 10 21:00:01 2026 UTC