0

I've been seeing this error in my logs for a couple of days ago when I did a composer update of my project.  

[2015-09-28 17:51:21] php.CRITICAL: Fatal Error: Invalid serialization data for DateTime object

Is it a bug Symfony2?

1 Answer 1

1

First of all, you should provide more information, if you want someone help you. But for now, I can suggest you to look at this issue posted on bugs.php.net.

Here is the solution posted there:

public function serialize() {
    return \serialize(array($this->myDateTimeObj->format('Y-m-d H:i:s')));
}
Sign up to request clarification or add additional context in comments.

2 Comments

Where i must to place that?
@phpprogrammer I don't know the structure of your project.. May be in some security classes (I usually implement \Serializable interface in my User class which implements the UserInterface), may be in vendor bundles.. There should be some objects which are being serialized..

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.