为什么我注释掉了这两行代码这个结果都还没有变?
<?php
class nbaPlayer{
// public $name;
//public $team;
function __construct($name,$team){
$this->name = $name;
$this->team = $team;
}
public function name(){
echo "球员名:".$this->name."\n";
}
public function team(){
echo "球队名:".$this->team."\n";
}
}
$James = new nbaPlayer('James','Cavaliers');
$James->name();
$James->team();
?>
为什么我把最上面的两个属性注销掉与没注销的结果一致,哪位大神能解释一下这每行代码的意思,感激不尽。