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?