Fri, 17 May 2024


Is it possible in PHP to preserve the object methods when serializing the object?

By: Anton, NetArt Media
Fri, 15 January 2021

No, unfortunately this is not possible. That means that whenever you
serialize an object with the PHP function serialize, its methods will be
lost (and you'll not be able to restore them with unserialize anymore).
Serializing in PHP could be used only to serialize simple variable of
type string, integer, double, array and object.


Category: PHP Examples
Share this post:



See All Scripts






Subscribe for our newsletter

Receive the latest blog posts direct in your mailbox