Using the object system in PHP5 just has a more refined feel that in previous versions of PHP, and one of the features that contributes to this is object overloading. In this new article from the O'Reilly Network, they explain to you what object overloading is and how you can really benefit from it.
A fine implementation of the object-overloading paradigm has found its way into PHP version 5. This article explores the possibilities of the overload methods __call(), __set(), and __get(). After explaining the basic theory of overloading, it dives straight into the topic by using two practical examples: first, implementing persistable classes, and second, figuring out a way to realize dynamic getter and setter methods. If you do not yet know what these terms mean, don't be afraid--it will become clear to you when you see the example code.
On a basic level, object overloading consists of two things: method and property overloading. They focus on the first, showing you how to create a "catch-all" call that will fail a bit more gracefully when certain things happen - like calling a method that doesn't exist...




