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

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

WBOY
Release: 2016-06-13 11:17:56
Original
1234 people have browsed it

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();

?

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template