为什么$pri用的是父类的属性?

0
PHP C/C++ 35762 次浏览

为什么不全是调用父类的属性?为什么只有$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();
?>
请尽量让自己的答案能够对别人有帮助

126个答案

默认排序 按投票排序
0

I wanna know more about this because this is really informative! acupuncture virginia beach va

0

I highly appreciate your work here! Thank you so much!

pain management santa barbara ca

0

I love your content! Great job!

acupuncture anchorage ak

0

Really interesting. I should try this one too at Fences Edgware!

0

I really find this one very useful. Hialeah Pool Cleaner

0

Your post is awesome! We support you. lost book of herbal remedies review

0

This is really awesome and informative, best part of this post is your unique concept which is different from other thought.  http://www.cleaniful.com

0

Great site thanks admin. More power.  
https://breastaugmentationminneapolismn.com

0

 Nice blog and absolutely outstanding.  You can do something much better but i still say this perfect. Keep trying for the best .deck repair lincoln ne

0

时间,好奇的时间 financialadvisorstylertx.com

0

雄岩盯着午夜海 kitchenremodelingdaytonohio.com

0

但与里面的野兽 guitarlessonsfresnoca.com

0

This is such a great resource that you are providing and you give it away for free. I love seeing blog that understand the value of providing a quality resource for free. -Trina

0

I can set up my new idea from this post. It gives in depth information. Thanks for this valuable information for all,.. -Hillary

0

thank you for this! really appreciate you doing this www.boudoirphotographysanfranciscoca.com

0

really great content i like it very much.. Anthony Scott Dietrich

0

great blog spot admin! please keep posting more! and please email me admin thanks! build fence

0

Please kindly allow this one time: canton roofing : canton snow removal : canton water heaters

1 2 3 4 5 6 7