2020-12-28 PHP中面向对象3种权限详解 PHP中面向对象3种权限详解 public(公有)protected(受保护)private(私有)外部YNN子类中YYN本类中YYY<?php class Human { public $money = '3000'; protected $car = 'BMW'; private $gf = 'mv'; public function par() { echo $this->money; echo $this->car; echo $this->gf; } } class Stu extends Human { public function sub() { echo $this->money; echo $this->car; echo $this->gf; } } $stu = new Stu; $stu->par(); $stu->sub(); //gf没有被继承 echo $s... 2020年12月28日 896 阅读 0 评论