Overview
KB
Technical FAQ
PHP Manual
CSS2 Manual
HTML Manual
JS Guide
JS Reference
PhpDock Manual
Nu-Coder Manual
PhpExpress Manual
PHP Joomla
Development
Learn PHP
 
<SplObjectStorage::setInfoSplObjectStorage::valid>
^SplObjectStorageLast updated: Mon, 26 Oct 2026

SplObjectStorage::unserialize

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

SplObjectStorage::unserialize — Unserializes a storage from its string representation

Description

public function SplObjectStorage::unserialize(string $data): void

Unserializes storage entries and attach them to the current storage.

Parameters

data

The serialized representation of a storage.

Return Values

No value is returned.

Examples

Example #1 SplObjectStorage::unserialize() example

<?php
$s1 = new SplObjectStorage;
$s2 = new SplObjectStorage;
$o = new stdClass;
$s1[$o] = "data";

$s2->unserialize($s1->serialize());

var_dump(count($s2));
?>

The above example will output something similar to:

int(1)

See Also


<SplObjectStorage::setInfoSplObjectStorage::valid>
^SplObjectStorageLast updated: Mon, 26 Oct 2026