php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #59045 DateTime not fetched/deserialized correctly
Submitted: 2010-01-25 16:27 UTC Modified: 2010-01-25 16:37 UTC
From: eda-qa at disemia dot com Assigned:
Status: Not a bug Package: APC (PECL)
PHP Version: 5.2.4 OS:
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:
38 - 6 = ?
Subscribe to this entry?

 
 [2010-01-25 16:27 UTC] eda-qa at disemia dot com
Description:
------------
DateTime objects are not properly retrieved from the cache. Attempting to work with the object results in a failure.

I'm accessing the sample code via a web page.

Reproduce code:
---------------
<?php

date_default_timezone_set('Europe/Berlin');
	
$d = new DateTime();
print( $d->format(DateTime::W3C) . "\n" );
apc_store( 'q1', $d );
print( apc_fetch( 'q1' )->format( DateTime::W3C ) . "\n" );

?>

Expected result:
----------------
The same datetime should be printed twice.

Actual result:
--------------
( ! ) Warning: DateTime::format() [function.DateTime-format]: The DateTime object has not been correctly initialized by its constructor in /home/projects/Current/vmed/web/test/datetime.php on line 7

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-01-25 16:30 UTC] rasmus@php.net
You can't cache internal objects.
 [2010-01-25 16:37 UTC] eda-qa at disemia dot com
For those interested:
http://bugs.php.net/bug.php?id=41334
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 10:01:28 2024 UTC