SplObjectStorage
在线手册:中文  英文

SplObjectStorage::unserialize

(PHP 5 >= 5.2.2)

SplObjectStorage::unserializeUnserializes a storage from its string representation

说明

public void SplObjectStorage::unserialize ( string $serialized )

Unserializes storage entries and attach them to the current storage.

参数

serialized

The serialized representation of a storage.

返回值

没有返回值。

范例

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));
?>

以上例程的输出类似于:

int(1)

参见


SplObjectStorage
在线手册:中文  英文
易百教程