#46932 [Opn]: strtotime() has inconsistency between 'next Monday' and '+1 Monday'
| From: | jani@php.net | Date: | Mon, 11 May 2009 08:50:33 +0000 |
| Subject: | #46932 [Opn]: strtotime() has inconsistency between 'next Monday' and '+1 Monday' | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-2232@lists.php.net to get a copy of this message | ||
ID: 46932
Updated by: jani@php.net
Reported By: for-bugs at hnw dot jp
Status: Open
Bug Type: Documentation problem
Operating System: any
PHP Version: 5.2.8
New Comment:
Both PHP_5_2 and PHP_5_3 output same now.
Previous Comments:
------------------------------------------------------------------------
[2009-01-15 08:39:24] for-bugs at hnw dot jp
How about PHP 5.2.8? PHP 5.2.8 also does same behavior.
I think this behavior is introduced by fix #43452.
http://bugs.php.net/bug.php?id=43452
The bug ticket has been closed, but this confused behaviour is not
documented.
------------------------------------------------------------------------
[2008-12-23 14:14:18] derick@php.net
5.3 does the proper behavior.
------------------------------------------------------------------------
[2008-12-23 06:18:53] for-bugs at hnw dot jp
Description:
------------
With PHP 5.2.8 or 5.3.0alpha3, 'next Monday' and '+1 Monday' is
diffrenet. On Monday, 'next Monday' seems the same day. However, '+1
Monday' means 1 week later.
'next day' and '+1 day' performs the same behavior, so it is natural to
me that 'next Monday' and '+1 Monday' is the same meanings.
In addition, my GNU date command never accept '+1 Monday' and 'next
Monday' on Monday means the same day. So, I cannot tell what is the
right behavior. I only report inconsistency.
Reproduce code:
---------------
<?php
var_dump(date("Y-m-d",strtotime("+1 Monday 2008-12-01")));
var_dump(date("Y-m-d",strtotime("next Monday 2008-12-01")));
Actual result:
--------------
string(10) "2008-12-01"
string(10) "2008-12-08"
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=46932&edit=1