Home >Backend Development >PHP Tutorial > php调用函数->跟:有什么区别吗?

php调用函数->跟:有什么区别吗?

WBOY
WBOYOriginal
2016-06-13 13:08:37881browse

php调用函数->和::有什么区别吗???
php调用函数->和::有什么区别吗???

------解决方案--------------------
...你回头看哈书吧,类的那个章节,
::是调用父类(parent)、自己(self)或者直接调用类的静态函数(class::method())等
->是实例化后的调用($class->method()),当然要注意this这个特殊的调用自身等情况($this->method(), $this->variable)
------解决方案--------------------
静态调用和动态调用的的区别
------解决方案--------------------
->调用实例方法
::调用静态方法

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