interface Serializable (View source)

Interface for customized serializing.
As of PHP 8.1.0, a class which implements Serializable without also implementing __serialize() and __unserialize() will generate a deprecation warning.

Methods

string|null
serialize()

String representation of object.

void
unserialize(string $data)

Constructs the object.

Details

string|null serialize()

String representation of object.

Return Value

string|null

The string representation of the object or null

Exceptions

Exception

void unserialize(string $data)

Constructs the object.

Parameters

string $data

The string representation of the object.

Return Value

void