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

Enjoyed this post? Share it!

 

Leave a comment

Your email address will not be published.