Home  >  Article  >  Backend Development  >  PHP中SESSION传对象时,该对象居然不能有构造函数

PHP中SESSION传对象时,该对象居然不能有构造函数

WBOY
WBOYOriginal
2016-06-13 13:05:33847browse

PHP中SESSION传对象时,该对象竟然不能有构造函数

下午想把一个CLASS整理一下,精炼一点,用了一个__construct()构造函数,过了几个小时重新登录的时候怎么也登录不了,查了半天程序,原来是php中session传class对象时,该对象不能有构造函数,真是搞死我了。不过这是为什么呢,难道是有构造函数的对象不能够序列化吗?

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn