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
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
43 - 2 = ?
Subscribe to this entry?

 
 [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

Add a Patch

Pull Requests

Add a Pull Request

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-2024 The PHP Group
All rights reserved.
Last updated: Tue May 28 08:01:29 2024 UTC