<?php
class Test {
static public function sayHi() {}
}
$obj = new Test;
//первый вариант вызова
$obj::SayHi();
//второй вариант вызова
$obj->sayHi();
?>
<?php
class Test{
private static function get_name(){
return "Vasiliy";
}
public function __call($one,$two) {
return self::get_name();
}
public static function __callStatic($one,$two){
echo "Static method";
return self::get_name();}
}
$obj=new Test;
echo $obj->get_name()."<br>";;
echo Test::get_name();
Vasiliy
Static methodVasiliy
#0 Test::sayHi() called at [/tmp/test.php:11]
#0 Test::sayHi() called at [/tmp/test.php:13