(PHP 5 >= 5.2.2, PHP 7, PHP 8)
SplObjectStorage::unserialize — Unserializes a storage from its string representation
Unserializes storage entries and attach them to the current storage.
data
The serialized representation of a storage.
Не повертає значень.
Приклад #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));
?>
Поданий вище приклад виведе щось схоже на:
int(1)