作业帮 > 综合 > 作业

在php中$this->_power=$status;这个语句中->是什么意思呢?

来源:学生作业帮 编辑:拍题作业网作业帮 分类:综合作业 时间:2024/06/02 04:27:41
在php中$this->_power=$status;这个语句中->是什么意思呢?
整个的代码是这样的:
class Appliance{
private $_power;
function setpower($status){
$this->_power=$status;
}
}
.
$blender=new Appliance;
对象的引用
比如你上面的
$this->_power是指$_power这个变量
$this->_power=$status;
意思是为变量$_power赋值$status
$this是当前对象的意思
->是引用的意思