|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #41334 Enable serialization of DateTime objects
Submitted: 2007-05-08 21:33 UTC Modified: 2008-07-07 19:54 UTC
Avg. Score:5.0 ± 0.0
Reproduced:2 of 2 (100.0%)
Same Version:0 (0.0%)
Same OS:2 (100.0%)
From: mail at philipp-wagner dot com Assigned: derick (profile)
Status: Closed Package: Feature/Change Request
PHP Version: 5.2.2 OS: all
Private report: No CVE-ID: None
 [2007-05-08 21:33 UTC] mail at philipp-wagner dot com
As noted in bug #39821 and the documentation, DateTime objects cannot be serialized.
Still, serializing such objects would be of much use. I use these objects heavily, as well as serialize(). Currently I have to write a __destruct() method which saves the DateTime into a string object variable and read it back at __wakeup(). This causes much unnecessary work.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2008-07-07 19:54 UTC]
This has been implemented some time ago - for PHP 5.3.
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Mon Jun 14 14:01:23 2021 UTC