Home  >  Article  >  Backend Development  >  一个面向对象的基础编程,该如何解决

一个面向对象的基础编程,该如何解决

WBOY
WBOYOriginal
2016-06-13 11:53:25888browse

一个面向对象的基础编程
$this->$name;
$this->name;
$this->name;是调用当前对象的name属性,$this->$name;是干什么的?二者有什么区别?
------解决方案--------------------
$name = 'abc';
$this->$name;
调用当前对象的 abc 属性
------解决方案--------------------
$this->name是直接调用
$this->$name间接调用

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn