php.net |  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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: for-bugs at hnw dot jp
New email:
PHP Version: OS:

 

 [2010-11-07 04:24 UTC] for-bugs at hnw dot jp
Description:
------------
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: http://stackoverflow.com/questions/961074/how-do-i-compare-two-datetime-objects-in-php-5-2-8


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-11-07 06:19 UTC] frozenfire@php.net
Automatic comment from SVN on behalf of frozenfire
Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=305145
Log: Added example of using comparison operators to compare DateTime objects, as per bug #53249.
 [2010-11-07 06:19 UTC] frozenfire@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: frozenfire
 [2010-11-07 06:19 UTC] frozenfire@php.net
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
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 [2010-11-07 06:21 UTC] frozenfire@php.net
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-2025 The PHP Group
All rights reserved.
Last updated: Wed Jan 15 15:01:31 2025 UTC