hi there,
I have one question
here is my code taken from the internet which is about the static function
but i dont exactly understand for what reason we use here static function and
what does mean self and code which is below
can anyone explain it to me
<?php
class Dynamic {
static protected $methods = array();
public static function registerMethod($method) {
self::$methods[] = $method;
}
private function __call($method, $args) {
if (in_array($method, self::$methods)) {
return call_user_func_array($method, $args);
}
}
}
function test() {
print "Hello World" . PHP_EOL;
}
Dynamic::registerMethod('test');
$d = new Dynamic();
$d->test();
?>
and i dont understand here
line 6 (self:: ), 10, 11 and the purpose of __call function
thanks beforehands