What’s the difference between __sleep and __wakeup?
- __sleep serializes
- __wakeup serializes
- Both are the same
- __wakeup unserializes
__sleep is called before an object is serialized, allowing you to define which data should be serialized. __wakeup is called after unserialization. Learn more: http://php.net/manual/en/language.oop5.magic.php
Loading...
Related Quiz
- How do you handle errors when using mail functions in PHP?
- The filter_var() function with the FILTER_SANITIZE_STRING filter is used to sanitize a string in PHP.
- In PHP, integers can be specified in decimal (base 10), hexadecimal (base 16), octal (base 8), and ______ (base 2) format.
- Which of the following are true about the default keyword in a PHP switch statement?
- What are the potential issues with a do...while loop in PHP?