From PHPEverywhere this morning, there's a link to an article from phpPatterns talking about using the Overload extension function calls with your classes.
This is how the magic happens: The overload extension defines three "magic" functions; __call(), __set() and __get(). If we place these in a class then declare (outside the class) that it is overloaded, PHP will use the magic functions if it finds that a member variable or function does not exist.
It's a pretty cool feature that they've built into the standard PHP build (since 4.3.0 was released), you can use them as a sort of "error catcher" for undeclared variables or functions. For example, when you try to use a variable (or function) that doesn't exist in your class already, the __call() function would get summoned, spitting back whatever you specified inside of it, whether it be an error or just to write the instance to a log.




