Skip to content

Instantly share code, notes, and snippets.

@myanmarlinks
Created July 9, 2017 16:43
Show Gist options
  • Save myanmarlinks/d508be056bd27addf119467bde083e59 to your computer and use it in GitHub Desktop.
Save myanmarlinks/d508be056bd27addf119467bde083e59 to your computer and use it in GitHub Desktop.
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