天蓬老师2017-07-27 08:21:39
public function __get($name) { return $this -> $name; //$name是外部传参,属于变量 }
Please modify the syntax in your class.
Also, your syntax for calling attributes of external objects is correct.
The magic method __get() you defined will only take effect when calling a property that does not exist in the class.