php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #52199 DateTime::setDate() return value documentation is unclear
Submitted: 2010-06-28 14:07 UTC Modified: 2010-09-22 03:46 UTC
From: vedad at kajtaz dot net Assigned: cataphract (profile)
Status: Closed Package: Documentation problem
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
 [2010-06-28 14:07 UTC] vedad at kajtaz dot net
Description:
------------
The DateTime::setDate() documentation states that the method "Returns the modified DateTime object or FALSE on failure.".

Then, a couple of lines later, in "ChangeLog", it says "5.3.0	Changed the return value from NULL to DateTime."

It is unclear whether the method returns NULL or DateTime on success, and whether it returns NULL or FALSE on failure, in PHP 5.2.

Thanks,


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-09-22 03:43 UTC] cataphract@php.net
Automatic comment from SVN on behalf of cataphract
Revision: http://svn.php.net/viewvc/?view=revision&revision=303654
Log: - Clarified that return value change on DateTime methods is for success cases (closes bug #52199).
 [2010-09-22 03:46 UTC] cataphract@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: cataphract
 [2010-09-22 03:46 UTC] cataphract@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.

If the current return is DateTime on success and FALSE on failure and in PHP 5.2 the reutn value changed from NULL to DateTime, the changelog must have been referring to the success return value.

But to make it clearer, I added "on success" to the changelog message.
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Sat Oct 10 15:00:01 2026 UTC