SplObjectStorage::unserialize

(PHP 5 >= 5.2.2, PHP 7)

SplObjectStorage::unserializeUnserializes a storage from its string representation

说锟斤拷

public SplObjectStorage::unserialize ( string $serialized ) : void

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)

锟轿硷拷