略微加速

PHP官方手册 - 互联网笔记

PHP - Manual: SplObjectStorage::unserialize

2024-05-13

SplObjectStorage::unserialize

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

SplObjectStorage::unserializeUnserializes a storage from its string representation

说明

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

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)

参见

add a noteadd a note

User Contributed Notes

There are no user contributed notes for this page.

官方地址:https://www.php.net/manual/en/splobjectstorage.unserialize.php

北京半月雨文化科技有限公司.版权所有 京ICP备12026184号-3