PHP __call and __callStatic Magic methods
Sunday, August 24th, 2008This is just a quick post to show the use of the magic methods __call and __callStatic. It’s following on in my Magic Method series. The concept is very similar to __set/__get, basically PHP attempts to call a method on a class, if it doesn’t exist the __call method is invoked (if it does exist). __callStatic is exactly the same but with static method calls.
Note that __callStatic will only be available from PHP 5.3 onwards.
Here is a quick example to show it in use;
<?php
// This example assumes ayou already have a DB connection
// established and a database has been [...]
