|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2010-01-25 16:30 UTC] rasmus@php.net
[2010-01-25 16:37 UTC] eda-qa at disemia dot com
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 29 16:00:01 2025 UTC |
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