954,561 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

What’s the meaning of __sleep and __wakeup?

Please anybody tell me the meaning of __sleep and __wakeup.

shilpamg
Newbie Poster
12 posts since Aug 2008
Reputation Points: 10
Solved Threads: 0
 

__sleep() and __wakeup() run prior to serialize() and unserialize() respectively.
http://us.php.net/oop5.magic
__sleep() returns an array of all variables prior to serializing an object
__wakeup() also runs prior to unserializing an object to reestablish any database connections etc... for that object prior to unserialization

R0bb0b
Posting Shark
998 posts since Jun 2008
Reputation Points: 358
Solved Threads: 89
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You