Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
imap_open 返回的 imap 资源可以序列化吗?
反序列化时出现错误“期望参数 1 是资源,给定整数”。
不,根据文档:“serialize() 处理所有类型,除了资源类型。”
想想看。serialize 只能处理 PHP 进程中物理存储的内容。当连接关闭时,所有服务器端状态、登录数据等都会丢失。即使客户端数据被序列化,服务器也会忘记存在的连接,并且在取消序列化时,客户端会说“嘿,伙计,还记得我吗?” 服务器将变为“否”。