Itís not breaking news that the release of PHP 5 drastically changed the way that many developers build their web-based programs. The incorporation of a much more robust object model, along with the introduction of native exceptions, type hinting and so forth (add your own improvement to the list) has given the language the maturity that we see in it today. This seven-part article series will explain an important new feature: magic functions.
Among the new features introduced in PHP 5, magic functions are an important part of the whole enhancement process. They've also been rather overlooked by some programmers, either because of laziness or ignorance.
Despite their funny name, magic functions permit users to perform difficult tasks effortlessly. They can be powerful time-savers for loading resources automatically, or for overloading methods and properties of classes, to cite just two illustrative examples.
Naturally, for experienced developers, magic functions are an old creature they've long since tamed, but for beginners, learning how to use them in a true productive manner can be challenging experience -- especially when they're utilized during the development of object-oriented applications.
So, if you're a PHP programmer who wishes to learn how to master the basic concepts that surround the implementation and use of magic functions, then in this series of articles you'll find a comprehensive guide that will show you how to work with them, using a strong hands-on approach.
In the successive tutorials of the series, I'm going to cover the most relevant magic functions provided by PHP 5, starting with the "__set()" and __"get()" methods. Future parts will explore the "__call()", "__sleep() and "__wakeup() functions, and even later I will discuss the use of "__isset()", "__unset()", "__clone()", "__destruct()" and "__autoload()" respectively.
By the end of this series, you should be armed with a solid background in the theory of using magic functions. You'll also have practiced with a good number of concrete examples.
Now, it's time to leave the preliminaries start discovering the real power behind utilizing magic functions. Let's get started right away!