What’s the meaning of __sleep and __wakeup?

Reply

Join Date: Aug 2008
Posts: 12
Reputation: shilpamg is an unknown quantity at this point 
Solved Threads: 0
shilpamg shilpamg is offline Offline
Newbie Poster

What’s the meaning of __sleep and __wakeup?

 
0
  #1
Aug 21st, 2008
Please anybody tell me the meaning of __sleep and __wakeup.
Reply With Quote Quick reply to this message  
Join Date: Jun 2008
Posts: 849
Reputation: R0bb0b is on a distinguished road 
Solved Threads: 67
R0bb0b's Avatar
R0bb0b R0bb0b is offline Offline
Practically a Posting Shark

Re: What’s the meaning of __sleep and __wakeup?

 
0
  #2
Aug 21st, 2008
__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
“Be who you are and say what you feel because those who mind don't matter and those who matter don't mind.” - Dr. Seuss

-- The documentation is inevitable, you may get away with it for a little while but eventually you too will have to do the deed.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the PHP Forum


Views: 614 | Replies: 1
Thread Tools Search this Thread



Tag cloud for PHP
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC