Browsing articles tagged with " PHP Magic methods"
Feb 18, 2009
admin

PHP 5 Magic – __sleep() and __wakeup() methods


Hello Friends,

The magic method _sleep() and _wakeup() is called when an object is serialized. The magic method _sleep() and _wakeup() provides a method to clean up and restore objects before being serialized.

Working with _sleep()

_sleep() magic method is called when the object of a class is about to be serialized. This magic method _sleep() does not accept any parameter and returns an array. The array should contain a list of class members that should be serialized. This means that if you don’t wish to serialize a particular class member, you should not include it in the array. Look at the example below: Continue reading »

Support to grow

If you think my post is helps you then please make donation and do support to grow:

PHP Genious Services

I am a PHP freelancer india, PHP Developer india, PHP programmer india, Wordpress Freelancer india, Wordpress customization services, Wordpress Plugin Developer, Wordpress theme customization, Wordpress plugin customization, Magento Freelancer, Magento Developer india, Magento customization services, Magento theme integration, Opencart Developer india, Zencart Freelancer, Opencart customization, Opencart plugin development, HTML and CSS customization, cakePHP Developer, cakePHP Freelancer india, Ecommerce Developer india

Click Here for

Follow me on Facebook

Categories

Get Adobe Flash player