|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #53249 No documentation about comparison between two Datetime objects
Submitted: 2010-11-07 04:24 UTC Modified: 2010-11-07 06:21 UTC
From: for-bugs at hnw dot jp Assigned: frozenfire (profile)
Status: Closed Package: Date/time related
PHP Version: 5.3.3 OS: -
Private report: No CVE-ID: None
 [2010-11-07 04:24 UTC] for-bugs at hnw dot jp
Comparison between two Datetime objects works fine in PHP5.2.2-PHP5.3.x, but it seems that there is no documentation.

In #40691, behavior of == operator with DateTime was discussed and it was fixed in PHP 5.2.2. However, <, <=, > and >= operator was also provided by this fix.

I think these comparison is very useful, so it should be described as specifications.

See also:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2010-11-07 06:19 UTC]
Automatic comment from SVN on behalf of frozenfire
Log: Added example of using comparison operators to compare DateTime objects, as per bug #53249.
 [2010-11-07 06:19 UTC]
-Status: Open +Status: Closed -Assigned To: +Assigned To: frozenfire
 [2010-11-07 06:19 UTC]
This bug has been fixed in SVN.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
Thank you for the report, and for helping us make PHP better.

 [2010-11-07 06:21 UTC]
Regarding my last comment, I had used a "quick fix" template for the bug resolution. The documentation for using comparison operators with DateTime objects will be in DateTime::diff.
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Wed May 31 16:03:37 2023 UTC