Get the App
SLTechnology News&Howtos  ›  Development  › 

What does the arrow mean in php?

Shulou Source: shulou.com Published: 2022-06-02 16:39:23 10月05日 Update

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.

Tags: Arrowhead method operator operation instance property example meaning code symbol right operator article class name syntax special next personal used in example sentence Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Docker Redmi Shulou Information macOS Shulou Technology