梦幻诛仙丹青阁加点: 為什么$pri用的是父類的屬性?

0
PHP C/C++ 10866 次瀏覽

梦幻诛仙手游丹青阁天书 www.rasug.icu 為什么不全是調用父類的屬性?為什么只有$pri用的是父類的私有屬性?

<?php
class father {
  public $pub='public';
  private $pri='private';
  protected $pro='protected';
  public function getpri(){
    echo $this->pri;
    echo $this->pro;
    echo $this->pub;
  }
}
class son extends father{
  public $pub='王二';
  private $pri='黃金時代';
  protected $pro='沉默的大多數';
  public function getpub(){
    echo $this->pub.'';
    echo $this->pro;
    echo $this->pri;
  }
}
$son=new son;
$son->getpri();
?>
請盡量讓自己的答案能夠對別人有幫助

5個答案

默認排序按投票排序
0

Thanks for sharing this codes.

Check this out postknight pets

0

The article is exceptionally good and straightforward. This is precisely what I require.  text twist
 

0

This article is really fantastic and thanks for sharing the valuable post.

Raft Wars 2

1

得到的

0

test

相似問題

相關經驗

相關資訊

相關文檔