Home  >  Article  >  Backend Development  >  PHP支持 子类重写父类的 私有步骤

PHP支持 子类重写父类的 私有步骤

WBOY
WBOYOriginal
2016-06-13 11:17:561209browse

PHP支持 子类重写父类的 私有方法?

写道
class A{
private function aa(){
echo 123;
}

private function aa1(){
echo 123;
}
}

class B extends A{
protected function aa($b){
echo 456;
}
protected function aa1($b){
echo 456;
}
static function a(){
$m = new self();
$m->aa(1);
}
}

B::a();

?

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:怎样防止sql注入?Next article:LAJP是什么?