php8.5
Home/ Manual/ predefined / serializable/ Serializable::serialize

Serializable::serialize

PHP function Edit on GitHub ✎

(PHP 5 >= 5.1.0, PHP 7, PHP 8)

String representation of object

Description

Serializable::serialize(): string|null

Should return the string representation of the object.

Parameters Parameters

Return Values

Returns the string representation of the object or null

Errors/Exceptions

Throws Exception when returning other types than strings and null.

See Also

Source: language/predefined/serializable/serialize.xml · from the official PHP manual (php/doc-en)