为什么我把最上面的两个属性注销以后代码运行结果跟之前一样?
<?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();
?>