php 抽象类和__callStatic()
abstract class xyz{//抽象类
public static function __callStatic($method, $args)//在静态上下文中调用一个不可访问方法时,__callStatic() 会被调用。
{
echo "Calling static method '$method' "
. implode(', ', $args). "\n";
echo def::$method($args);
}
}
class def extends xyz{
public function boot1(){
echo 'def';
}
}
def::boot1('in static context');exit;
class abc {
public function test(){
def::boot1();
}
protected static function boot()
{
echo 'abc22231';
}
}
$abc = new abc();
echo $abc->test();exit;
