PHP Magic Features
In this article we'll look at PHP's "magic" features: Magic methods are class methods with specific names, are used to perform various specialized tasks. They are grouped into two: overloading methods and non-overloading methods. Overloading magic methods are used when your code attempts to access a method or a property which does not exist. Non-overloading methods perform other tasks. Magic functions are similar to magic methods, but are just plain functions outside any class. Currently there is only one magic function in PHP. Magic constants are similar to constants in notation, but act more like "dynamic" constants - their value depends on where you use them. We'll also look at some practical examples of using some of these, and lastly we'll check out what new features PHP 5.3 is going to add.
|
|
Full Story |
This topic does not have any threads posted yet!
You cannot post until you login.