为什么类内部使用属性不需要用$符号
class classname {
$attribute;
function get() {
echo $this->attribute;
// 为什么不是$this->$attribute;
}
}
Copyright 2014-2026 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
学习是最好的投资!