__call( ) method is called if PHP fails to find the method
<?
class Dog {
public $Name;
public function bark( ) {
print "Woof!\n";
}
public function __call($function, $args) {
$args = implode(', ', $args);
print "Call to $function( ) with args '$args' failed!\n";
}
}
$poppy = new Dog;
$poppy->meow("foo", "bar", "baz");
?>
Related examples in the same category