What is the special meaning of __sleep and __wakeup?

Ads
 

What is the special meaning of __sleep and __wakeup?

What?s the special meaning of _sleep and _wakeup?

View Answers

November 15, 2010 at 3:23 PM

Hi all,

Special meaning of sleep : This is the magic function in php. serialize() checks if your class has a function with the magic name _sleep. If so, that function is executed prior to any serialization. It can clean up the object and is supposed to return an array with the names of all variables of that object that should be serialized. If the method doesn?t return anything then NULL is serialized and E_NOTICE is issued.

special meaning of wakeup : This is the magic function in php. unserialize() checks for the presence of a function with the magic name _wakeup. If present, this function can reconstruct any resources that the object may have.

Thanks

Ads









Related Tutorials/Questions & Answers:
What is the special meaning of __sleep and __wakeup?
What?s the special meaning of __sleep and __wakeup?
Advertisements
__sleep and __wakeup
what is the meaning of abstract?
what is the meaning this coad?
what is the meaning of this or explain this
What is the meaning of Java Platform?
What does a special set of tags <?= and ?> do in PHP?
why we use ^ operator in sql, and what is the meaning of that operator?
yield and sleep
Meaning of invoice
need a jar file to come out of sleep mode
example of sleep and wait method
MEANING OF THe CODE IN BOLD LETTERS
sleep method in thread java program
Java Thread : sleep() method
Java Sleep Thread
special set of tags do in PHP.
special characters in my HTML
special characters in my HTML
Protect Special Characters.
password validation with special character
regular expression for special characters
remove special characters iphone
Special Bean Types of WebApplicationContext
replace special characters in html
Tattoo Ideas for Girls with Meaning
PHP - Match Special Characters - PHP
How to avoid the Special characters? - JDBC
Meaning Of annatations and use - Java Interview Questions
PHP Sleep Wakeup Method

Ads