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

WBOY
Release: 2016-06-13 13:08:37
Original
862 people have browsed it

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

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

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!