What’s the special meaning of __sleep and __wakeup?
Answer / Sohan Sagar Jha
In PHP, `__sleep` and `__wakeup` are magic methods used for serialization (converting an object into a format that can be stored or transmitted) and unserialization (recovering data from the serialized format). The `__sleep` method returns an array of properties that should be serialized while the `__wakeup` method is called after an object has been unserialized.
| Is This Answer Correct ? | 0 Yes | 0 No |
Design a class that should always return a single object ?
How to check your php installation?
How do I stop a php script?
What is the maximum size of a database in mysql?
What is the purpose of the '.myd' file extension? What do thes file contain?
Tell me what is the use of "ksort" in php?
class Database { public static $_instance; public static function getInstance() { if(!isset(self::$_instance)) self::$_instance = new Database(DB_SERVER, DB_USER, DB_PASS, DB_NAME); print_r(self::$_instance); return self::$_instance; } } can any one explain "self::$_instance = new Database(DB_SERVER, DB_USER, DB_PASS, DB_NAME);" this line
What is inheritance in php? How many types of inheritance supports php?
What is a simple php method to make a cross domain data request?
Why php was called as personal home page?
Write a program to find a string is palindrome or not?
Explain include(), include_once, require() and require_once?