# Serialize

The Serialize component is in charge of handling variable serializing.

# Serialize a variable

SerializeInterface describes the interface for the component in charge of handling serialize.

use Chevere\Components\Serialize\Serialize;

$serialize = new Serialize(var: $foo);

The toString method is used to access the serialized variable.

$serialize->toString();

# Unserialize a variable

UnserializeInterface describes the interface for the component in charge of handling unserialize.

use Chevere\Components\Serialize\Unserialize;

$unserialize = new Unserialize(serialized: $bar);

# Access variable

The var method is used to access the unserialized variable.

$unserialize->var(); // mixed

# Variable type

The type method is used to access the unserialized variable type.

$unserialize->type(); // TypeInterface