What is the special meaning of __sleep and __wakeup?

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









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
ModuleNotFoundError: No module named 'sleep'
ModuleNotFoundError: No module named 'meaning'
java sleep in main method
java sleep in main method
MEANING OF THe CODE IN BOLD LETTERS
ModuleNotFoundError: No module named 'server-sleep'
ModuleNotFoundError: No module named 'sleep-after'
ModuleNotFoundError: No module named 'sleep-after'
ModuleNotFoundError: No module named 'sleep-after'
ModuleNotFoundError: No module named 'sleep-hotkey'
ModuleNotFoundError: No module named 'sleep-parameters'
ModuleNotFoundError: No module named 'flask-sleep'
ModuleNotFoundError: No module named 'name-meaning'
special characters in my HTML
special characters in my HTML
Protect Special Characters.
password validation with special character
regular expression for special characters
Java Thread : sleep() method
sleep method in thread java program
remove special characters iphone
special set of tags do in PHP.
Special Bean Types of WebApplicationContext
replace special characters in html
Java Sleep Thread
ModuleNotFoundError: No module named 'matialvarezs_time_sleep'
PHP - Match Special Characters - PHP
Tattoo Ideas for Girls with Meaning
ModuleNotFoundError: No module named 'numba-special'
ModuleNotFoundError: No module named 'special-k'
ModuleNotFoundError: No module named 'special_list'
ModuleNotFoundError: No module named 'special-k'
ModuleNotFoundError: No module named 'special_list'
ModuleNotFoundError: No module named 'special_snowflake'
How to avoid the Special characters? - JDBC
Meaning Of annatations and use - Java Interview Questions
How To Protect Special Characters in Query String?

Ads