引用至Stack Overflow: Reference - What does this symbol mean in PHP?
What is this?
This is a collection of questions that come up every now and then about syntax in PHP. This is also a Community Wiki, so everyone is invited to participate in maintaining this list.
Why is this?
It used to be hard to find questions about operators and other syntax tokens.¹
The main idea is to have links to existing questions on Stack Overflow, so it's easier for us to reference them, not to copy over content from the PHP Manual.
¹ Note: Since January 2013, Stack Overflow does support special characters. Just surround the search terms by quotes, e.g. [php] "==" vs "==="
What should I do here?
If you have been pointed here by someone because you have asked such a question, please find the particular syntax below. The linked pages to the PHP manual along with the linked questions will likely answer your question then. If so, you are encouraged to upvote the answer. This list is not meant as a substitute to the help others provided.
The List
If your particular token is not listed below, you might find it in the List of Parser Tokens.
&
Bitwise Operators or References
=&
References
??
Null Coalesce Operator (since PHP 7)
:
Alternative syntax for control structures, Ternary Operator
=>
Arrays
<=>
Comparison Operators (since PHP 7.0)
+
Arithmetic Operators, Array Operators
+=
and -=
Assignment Operators
++
and --
Incrementing/Decrementing Operators
<?=
Short Open Tags
[]
Arrays (since PHP 5.4)
...
Argument unpacking (since PHP 5.6)
**
Exponentiation (since PHP 5.6)
#
One-line shell-style comment