php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #69519 Incorrect return type for MongoDate::toDateTime
Submitted: 2015-04-23 19:02 UTC Modified: 2015-04-24 09:15 UTC
From: austin dot emmons at modolabs dot com Assigned: cmb (profile)
Status: Closed Package: Documentation problem
PHP Version: Irrelevant OS: N/A
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: austin dot emmons at modolabs dot com
New email:
PHP Version: OS:

 

 [2015-04-23 19:02 UTC] austin dot emmons at modolabs dot com
Description:
------------
---
From manual page: http://www.php.net/mongodate.todatetime
---

The method says it returns a string, but it returns a DateTime object.

Test script:
---------------
<?php
$d = new MongoDate(strtotime("2014-11-18 11:01:25"));
var_dump( $d->toDateTime() );
?>

Expected result:
----------------
I expect to see a DateTime object output.

Actual result:
--------------
I get a DateTime object output. The docs say it is a string though.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-04-23 19:04 UTC] austin dot emmons at modolabs dot com
It actually looks like this doc bug has been fixed when I go to edit the PHP doc. It must just not have been deployed to php.net yet.
 [2015-04-23 19:29 UTC] austin dot emmons at modolabs dot com
-Status: Open +Status: Closed
 [2015-04-23 19:29 UTC] austin dot emmons at modolabs dot com
See above comment, looks to be fixed when I try to edit the docs, I guess this will go out in next update to php.net
 [2015-04-23 23:48 UTC] cmb@php.net
-Status: Closed +Status: Suspended -Assigned To: +Assigned To: cmb
 [2015-04-23 23:48 UTC] cmb@php.net
> See above comment, looks to be fixed when I try to edit the docs,
> I guess this will go out in next update to php.net

Not necessarily. Patches that are submitted to the online editor
still need to be reviewed by the doc team, and that may take some
time. Therefore I'm marking this ticket as "suspended".
 [2015-04-24 09:15 UTC] salathe@php.net
Automatic comment from SVN on behalf of salathe
Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=336640
Log: MongoDate::toDateTime() returns DateTime (patch by cmb, doc bug #69519)
 [2015-04-24 09:15 UTC] salathe@php.net
-Status: Suspended +Status: Closed
 [2015-04-24 09:15 UTC] salathe@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.


 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Tue Oct 06 14:00:02 2026 UTC