What does the arrow mean in php?
Editor to share with you what the arrow means in php. I hope you will get something after reading this article. Let's discuss it together.
The arrowhead symbol of php is called the arrowhead operator. The left side of the arrowhead operator gets an instance of the class, and the right side specifies and invokes the methods and properties of the left class.
This article operating environment: windows7 system, PHP7.1 version, DELL G3 computer
What is the use of php arrowheads?
The "- >" symbol in php is called the arrowhead operator. The left side of the arrowhead operator gets an instance of the class, and the right side specifies and invokes the methods and properties of the left class. In this article, we will introduce the use of the arrowhead operator in php.
Use the-> symbol to reference the properties and methods of a class. -> means to call
Syntax:
Let's use the sample code to illustrate the arrow operator in php.
The syntax of the definition is as follows.
Next is the "instance", but this refers to the instance created from the defined class, which corresponds to the template above. If you specify the new operator and write it as the class name (), an instance is created.