PHP 类属性问题

为什么类内部使用属性不需要用$符号

class classname {

        $attribute;
        function get() {
                echo $this->attribute; 
                //  为什么不是$this->$attribute; 
        }

}

阅读 2.2k
1 个回答
推荐问题