Created
July 9, 2017 16:43
-
-
Save myanmarlinks/d508be056bd27addf119467bde083e59 to your computer and use it in GitHub Desktop.
PHP Magic Methods Program (3)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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