Documentation

MarshallerInterface

Serializes/unserializes PHP values.

Implementations of this interface MUST deal with errors carefully. They MUST also deal with forward and backward compatibility at the storage format level.

Tags
author

Nicolas Grekas p@tchwork.com

Table of Contents

marshall()  : array<string|int, mixed>
Serializes a list of values.
unmarshall()  : mixed
Unserializes a single value and throws an exception if anything goes wrong.

Methods

marshall()

Serializes a list of values.

public marshall(array<string|int, mixed> $values, array<string|int, mixed>|null &$failed) : array<string|int, mixed>

When serialization fails for a specific value, no exception should be thrown. Instead, its key should be listed in $failed.

Parameters
$values : array<string|int, mixed>
$failed : array<string|int, mixed>|null
Return values
array<string|int, mixed>

unmarshall()

Unserializes a single value and throws an exception if anything goes wrong.

public unmarshall(string $value) : mixed
Parameters
$value : string
Tags
throws
Exception

Whenever unserialization fails

Return values
mixed

Search results