Doc #72457 [Opn->Ver]: change in strtotime for invalid dates since 5.1.0
| From: | cmb@php.net | Date: | Mon, 20 Jun 2016 13:25:07 +0000 |
| Subject: | Doc #72457 [Opn->Ver]: change in strtotime for invalid dates since 5.1.0 | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-13560@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=72457&edit=1
ID: 72457
Updated by: cmb@php.net
Reported by: patrick at bigbridge dot nl
Summary: change in strtotime for invalid dates since 5.1.0
-Status: Open
+Status: Verified
Type: Documentation Problem
Package: Documentation problem
PHP Version: Irrelevant
-Assigned To:
+Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
Confirmed: <https://3v4l.org/Xi2J0>.
Previous Comments:
------------------------------------------------------------------------
[2016-06-20 09:28:22] 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.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=72457&edit=1