Home  >  Article  >  Backend Development  >  What is called the calling party?

What is called the calling party?

WBOY
WBOYOriginal
2016-08-04 09:19:02972browse

When I was reading the PHP Manual, I saw the section Attributes in Classes and Objects, which said:

When a method is called inside a class definition, there is a pseudo variable $this available. $this is a reference to the calling object (usually the object the method belongs to, but possibly another object if called statically from a second object).

After searching on the Internet, I still understand $this quite well, but I still don’t understand the calling object very well. Could you please explain it in a simple and easy-to-understand description?

Reply content:

When I was reading the PHP Manual, I saw the section Attributes in Classes and Objects, which said:

When a method is called inside a class definition, there is a pseudo variable $this available. $this is a reference to the calling object (usually the object the method belongs to, but possibly another object if called statically from a second object).

After searching on the Internet, I still understand $this quite well, but I still don’t understand the calling object very well. Could you please explain it in a simple and easy-to-understand description?

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