这是什么?
这是一个关于PHP语法的问题集合.这也是一个社区维基,所以每个人都被邀请参与维护这个列表.
这是为什么呢?
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.
注:自2013年1月起,堆栈溢出does support special characters.只需将搜索词用引号括起来,例如[php] "==" vs "==="
我该怎么办?
如果你在这里被人指出来是因为你问了这样一个问题,请在下面找到特定的语法.PHP manual的链接页面以及链接的问题很可能会回答您的问题.如果是这样的话,我们鼓励你对答案投赞成票.这份 list 并不能代替其他人提供的帮助.
名单
如果您的特定令牌未在下面列出,您可能会在List of Parser Tokens中找到它.
&
Bitwise Operators或References
- What does it mean to start a PHP function with an ampersand?
- Understanding PHP & (ampersand, bitwise and) operator
- PHP "&" operator
- Difference between & and && in PHP个
- What does "&" mean here in PHP?个
- What does "&" mean in this case?个
- What does the "&" sign mean in PHP?个
- What does this signature mean (&) in PHP?
- How does the "&" operator work in a PHP function?
- What does & in &2 mean in PHP?个
- When should I use a bitwise operator?
- Is there ever a need to use ampersand in front of an object?美元
=&
References
- Reference assignment operator in PHP, =&
- What do the "=&" and "&=" operators in PHP mean?个
- What do the '&=' and '=&' operators do?
- What does =& mean in PHP?
- 'AND' vs '&&' as operator
- Difference between & and && in PHP个
- Is there any difference between "and" and "&&" operators in PHP?个
- PHP - and / or keywords个
- What does the percent sign mean in PHP?个
- What is the PHP operator % and how do I use it in real-world examples?个
- What is the use of the @ symbol in PHP?
- 'At' symbol before variable name in PHP: @$_POST
- PHP functions and @functions个
- Should I use @ in my PHP code?
- What does @ mean in PHP?
- What are the PHP operators "?" and ":" called and what do they do?
- ?: operator (the 'Elvis operator') in PHP
- Where can I read about conditionals done with "?" and ":" (colon)?
- Using PHP 5.3 ?: operator
??
Null Coalesce Operator(自PHP7起)
?string
?int
?array
?bool
?float
Nullable return type declaration(从PHP 7.1开始)
- Nullable return type declaration
- Nullable parameter type declaration
- php method argument type hinting with question mark (?type)个
:
Alternative syntax for control structures、Ternary Operator、Return Type Declaration
- What do two colons mean in PHP?
- What's the meaning of the PHP token name T_PAAMAYIM_NEKUDOTAYIM?
- What's the difference between :: (double colon) and -> (arrow) in PHP?
- What exactly are late static bindings in PHP?
- static::staticFunctionName()
- Unexpected T_PAAMAYIM_NEKUDOTAYIM, expecting T_NS_Separator
- What is the "->" PHP operator called?个
- Where do we use the object operator "->" in PHP?个
- What's the difference between :: (double colon) and -> (arrow) in PHP?
- What does the PHP syntax $var1->$var2 mean?
- What does "->" mean/refer to in PHP?个
=>
Arrays
- What does <<<END mean in PHP?个
- PHP expression <<<EOB
- In PHP, what does "<<<" represent?个
- Using <<<CON in PHP
- What's this kind of syntax in PHP?
- How do the PHP equality (== double equals) and identity (=== triple equals) comparison operators differ?个
- PHP != and == operators
- The 3 different equals个
- Type-juggling and (strict) greater/lesser-than comparisons in PHP个
- What does "===" mean?
- How do the PHP equality (== double equals) and identity (=== triple equals) comparison operators differ?个
- The 3 different equals个
- Type-juggling and (strict) greater/lesser-than comparisons in PHP个
- PHP != and == operators
- Is there a difference between !== and != in PHP?个
- comparing, !== versus !=
- What is the difference between <> and !=
- PHP operator <>
- PHP's <> operator
- What is the difference between <> and !=
- Type-juggling and (strict) greater/lesser-than comparisons in PHP个
<=>
Comparison Operators(自PHP7.0以来)
- What is the difference between the | and || operators?个
- What Does Using A Single Pipe '|' In A Function Argument Do?
- What is the difference between the | and || operators?个
- PHP - and / or keywords个
- What exactly does || mean?个
- The behaviour of the or operator in PHP个
+
Arithmetic Operators, Array Operators
+=
和-=
Assignment Operators
++
和--
Incrementing/Decrementing Operators
- Difference between period and comma when concatenating with echo versus return?
- What does a . (dot) do in PHP?
- What does $$ (dollar dollar or double dollar) mean in PHP?个
- what is "$$" in PHP
- $function() and $$variable个
<?=
Short Open Tags
[]
Arrays(PHP 5.4之后的简短语法)
- PHP arrays... What is/are the meaning(s) of an empty bracket?
- What is the meaning of []
- Php array_push() vs myArray[]
- What does [] mean when reading from a PHP array?个
- Shorthand for arrays: literal
$var = []
empty array
...
Argument unpacking(自PHP5.6起)
**
Exponentiation(自PHP5.6起)
#
One-line shell-style comment
?->
NullSafe Operator Calls(自PHP 8.0以来)