Mega Code Archive

 
Categories / Php / Class
 

__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"); ?>