PHP 5.4.31 Released

Serializable::serialize

(PHP 5 >= 5.1.0)

Serializable::serializeString representation of object

Descrierea

abstract public string Serializable::serialize ( void )

Should return the string representation of the object.

Notă:

This method acts as the destructor of the object. The __destruct() method will not be called after this method.

Parametri

Această funcție nu are parametri.

Valorile întoarse

Returns the string representation of the object or NULL

Erori/Excepții

Throws Exception when returning other types than strings and NULL.

Vedeți de asemenea

add a note add a note

User Contributed Notes 1 note

up
1
crog at gustavus dot edu
8 months ago
The documentation here is somewhat misleading. Where it says "This method acts as the destructor of the object. The __destruct() method will not be called after this method," I believe the intent is not that the destructor is not run on the object itself, but that the destructor is not called /as part of the serialization process/.

That is, the object will still be destructed as it goes out of scope as normal, but the destructor is not called as a part of the object's serialization.
To Top