首页 > 文章列表 > php中__sleep方法的使用

php中__sleep方法的使用

php __sleep
214 2022-08-06

说明

1、在类的外部调用serialize()时自动调用。

2、__sleep()方法通常用于提交未提交的数据或类似的清理操作。如果有一些大对象,但不需要完全保存,这个功能非常有用。

实例

Output:
   Using the default text output, the message format is :
  MESSAGE_TYPE: LINE_NUM:[OBJECT:] MESSAGE
  There are 5 kind of message types :
  * (C) convention, for programming standard violation
  * (R) refactor, for bad code smell
  * (W) warning, for python specific problems
  * (E) error, for probable bugs in the code
  * (F) fatal, if an error occurred which prevented pylint from doing further processing.

推荐操作系统:windows7系统、PHP5.6、DELL G3电脑