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
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *