What is the caller object?

Source: Internet
Author: User
When reading PHPManual, you can see the attributes section in the class and object. It says: when a method is called inside the class definition, there is an available pseudo variable $ this. $ This is a reference to the main object (usually the object subordinate to the method, but if it is from the second object... when reading the PHP Manual, see Class and objectInside AttributeIn this section, we say:

When a method is called inside the class definition, there is an available pseudo variable $ this. $ This is a reference to the main object (usually the object subordinate to this method, but it may also be another object when it is called from the second object statically ).

I searched for $ this on the Internet, but I still don't know much about it. Can I explain it easily?

Reply content:

When reading PHP Manual, you can seeClass and objectInsideAttributeIn this section, we say:

When a method is called inside the class definition, there is an available pseudo variable $ this. $ This is a reference to the main object (usually the object subordinate to this method, but it may also be another object when it is called from the second object statically ).

I searched for $ this on the Internet, but I still don't know much about it. Can I explain it easily?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.