SplObjectStorage::unserialize
(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)
+添加备注
用户贡献的备注
此页面尚无用户贡献的备注。
备份地址:http://www.lvesu.com/blog/php/splobjectstorage.unserialize.php