php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #46891 Make DateTime (and any other internal class) serializable
Submitted: 2008-12-17 21:19 UTC Modified: 2008-12-17 21:29 UTC
From: markus at malkusch dot de Assigned:
Status: Closed Package: Feature/Change Request
PHP Version: 5.2.8 OS: Linux
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: markus at malkusch dot de
New email:
PHP Version: OS:

 

 [2008-12-17 21:19 UTC] markus at malkusch dot de
Description:
------------
DateTime is not serializable and therefore can't be stored in 
sessions.

Could you please make Datetime (and as much other internal classes 
as possible) serializable?

Thank you very much.

Reproduce code:
---------------
@see Bug 42239

Expected result:
----------------
At least PHP should tell a more verbose error message. The 
warning "The DateTime object has not been correctly initialized by 
its constructor" gives a very small hint to the serialization 
problem.


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-12-17 21:29 UTC] derick@php.net
This bug has been fixed in CVS.

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.

This has already been implemented for PHP 5.3.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Fri May 09 15:01:27 2025 UTC