Instantly share code, notes, and snippets.

Embed
What would you like to do?
PHP Magic Methods Program (3)
<?php
class Dog {
public function bark() {
echo "Woof! <br>";
}
public function __call($method, $arguments) {
var_dump($method);
var_dump($arguments);
}
public static function __callStatic($method, $arguments) {
var_dump($method);
var_dump($arguments);
}
}
Dog::dance();
$dog = new Dog();
$dog->bark();
$dog->eat("bone");
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment