News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

DevShed:
The Sleep and Wakeup Magic Functions in PHP 5
June 17, 2009 @ 08:49:19

DevShed has posted the next part of their series looking at the "magic functions" that PHP5+ has to offer you in your development. They've already looked at ones like __call, __clone and __isset/__unset and now, with this new tutorial they've added __sleep and __wake.

Magic functions are an important part of the numerous improvements and additions that were introduced originally in PHP 5. They can be extremely handy when it comes to simplifying the execution of complex tasks. [...] In this fourth chapter I'm going to examine closely the "__sleep()" and "__wakeup()" functions, which are called automatically when an object is serialized and unserialized respectively.

In their example code they add the __sleep and __wake functions to the class they've been developing to output a string when the object is manipulated. These methods are automatically called when a serialize/unserialize function call is made on the object.

0 comments voice your opinion now!
tutorial function magic wakeup sleep


blog comments powered by Disqus

Similar Posts

Henrik Bjørnskov's Blog: Travis & Composer sitting in a tree K-I-S-S-I-N-G

WebReference.com: How to Interact with Web Forms (Part 1)

PHPClasses.org Blog: Throttling Background Tasks: Unusual Site Speedup Techniques: Part 2

PHPMaster.com: Explore Aspect Oriented Programming with CodeIgniter, Part 3

Oracle Technology Network: Creating an Ajax Process Using PHP and Oracle


Community Events





Don't see your event here?
Let us know!


interview install list release api language podcast testing framework unittest series threedevsandamaybe symfony2 code refactor laravel opinion developer introduction community

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework