php - 引用-这个符号在PHP中是什么意思?

标签 php arguments logic operators symbols

这是什么?
这是有关PHP语法的不时出现的问题的集合。这也是一个社区Wiki,因此邀请所有人参与维护此列表。
为什么是这样?
过去很难找到有关运算符和其他语法标记的问题。¹
主要思想是链接到Stack Overflow上的现有问题,因此我们更容易引用它们,而不必复制PHP手册中的内容。
注意:自2013年1月起,堆栈溢出does support special characters。只需用引号将搜索字词括起来,例如 [php] "==" vs "==="
我应该在这里做什么?
如果有人因提出这样的问题而将您指向此处,请在下面找到特定的语法。到PHP manual的链接页面以及链接的问题可能会回答您的问题。如果是这样,建议您增加答案。此列表不能替代其他人提供的帮助。
列表
如果您的特定 token 未在下面列出,则可以在List of Parser Tokens中找到它。
& Bitwise OperatorsReferences

  • 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?
  • &= Bitwise Operators
  • What do the "=&" and "&=" operators in PHP mean?
  • What do the '&=' and '=&' operators do?
  • && Logical Operators
  • 'AND' vs '&&' as operator
  • Difference between & and && in PHP
  • Is there any difference between "and" and "&&" operators in PHP?
  • PHP - and / or keywords
  • % Arithmetic Operators
  • What does the percent sign mean in PHP?
  • What is the PHP operator % and how do I use it in real-world examples?
  • !! Logical Operators
  • Double not (!!) operator in PHP
  • @ Error Control Operators
  • 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?
  • ?: Ternary Operator
  • 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(自PHP 7起)
  • C#'s null coalescing operator (??) in PHP
  • ?string?int?array?bool?float Nullable return type declaration(自PHP 7.1起)
  • Nullable return type declaration
  • php method argument type hinting with question mark (?type)
  • : Alternative syntax for control structuresTernary OperatorReturn Type Declaration
  • What is ":" in PHP?
  • What does ":" mean in PHP?
  • Colon after method declaration?
  • :: Scope Resolution Operator
  • 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
  • \ Namespaces
  • Backslash in PHP -- what does it mean?
  • What does a \ (backslash) do in PHP (5.3+)?
  • -> Classes And Objects
  • 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 "=>" mean in PHP?
  • Use of => in PHP
  • What does $k => $v in foreach($ex as $k=>$v) mean?
  • ^ Bitwise Operators
  • How does the bitwise operator XOR ('^') work?
  • What does ^ mean in PHP?
  • >> Bitwise Operators
  • What does >> mean in PHP?
  • << Bitwise Operators
  • Strange print behaviour in PHP?
  • <<< Heredoc or Nowdoc
  • 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?
  • = Assignment Operators
  • The 3 different equals
  • == Comparison Operators
  • 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
  • === Comparison Operators
  • 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
  • !== Comparison Operators
  • What does !== comparison operator in PHP mean?
  • Is there a difference between !== and != in PHP?
  • != Comparison Operators
  • PHP != and == operators
  • Is there a difference between !== and != in PHP?
  • comparing, !== versus !=
  • What is the difference between <> and !=
  • <> Comparison Operators
  • PHP operator <>
  • PHP's <> operator
  • What is the difference between <> and !=
  • Type-juggling and (strict) greater/lesser-than comparisons in PHP
  • <=> Comparison Operators(自PHP 7.0起)
  • Spaceship (three way comparison) operator
  • | Bitwise Operators
  • What is the difference between the | and || operators?
  • What Does Using A Single Pipe '|' In A Function Argument Do?
  • || Logical Operators
  • What is the difference between the | and || operators?
  • PHP - and / or keywords
  • What exactly does || mean?
  • The behaviour of the or operator in PHP
  • ~ Bitwise Operators
  • What does this ~ operator mean here?
  • + Arithmetic OperatorsArray Operators
  • + operator for array in PHP?
  • +=-= Assignment Operators
  • What is += used for?
  • What does `$page -= 1` in my PHP document mean?
  • ++-- Incrementing/Decrementing Operators
  • Understanding Incrementing
  • Answer below
  • .= Assignment Operators
  • What is the difference between .= and += in PHP?
  • To understand a line of PHP
  • . String Operators
  • Difference between period and comma when concatenating with echo versus return?
  • What does a . (dot) do in PHP?
  • , Function Arguments
  • Difference between period and comma when concatenating with echo versus return?
  • , Variable Declarations
  • What do commas mean in a variable declaration?
  • $$ Variable Variables
  • What does $$ (dollar dollar or double dollar) mean in PHP?
  • what is "$$" in PHP
  • $function() and $$variable
  • ` Execution Operator
  • What are the backticks `` called?
  • <?= Short Open Tags
  • What does this symbol mean in PHP <?=
  • What does '<?=' mean in PHP?
  • What does <?= mean?
  • [] 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
  • <? Opening and Closing tags
  • Are PHP short tags acceptable to use?
  • ... Argument unpacking(自PHP 5.6起)
    ** Exponentiation(自PHP 5.6起)
    # One-line shell-style comment
  • Can I use hashes for comments in PHP?
  • ?-> NullSafe Operator Calls(自PHP 8.0起)
  • What does this symbol mean "?->" in php, within an object or null value
  • 最佳答案

    Incrementing / Decrementing Operators
    ++增量运算符
    --减量运算符

    Example    Name              Effect
    ---------------------------------------------------------------------
    ++$a       Pre-increment     Increments $a by one, then returns $a.
    $a++       Post-increment    Returns $a, then increments $a by one.
    --$a       Pre-decrement     Decrements $a by one, then returns $a.
    $a--       Post-decrement    Returns $a, then decrements $a by one.
    

    这些可以在变量之前或之后。

    如果放在变量之前,则先对变量进行增/减操作,然后返回结果。如果将变量放在变量之后,则先返回变量,再返回,然后执行递增/递减操作。

    例如:
    $apples = 10;
    for ($i = 0; $i < 10; ++$i) {
        echo 'I have ' . $apples-- . " apples. I just ate one.\n";
    }
    

    Live example

    在上面的情况下,使用了++$i,因为它更快。 $i++将具有相同的结果。

    预增量要快一点,因为它确实增加了变量,然后“返回”结果。后增量创建一个特殊变量,在其中复制第一个变量的值,只有在使用第一个变量之后,才将其值替换为第二个变量。

    但是,必须使用$apples--,因为首先要显示当前的苹果数,然后先从然后从中减去一个苹果。

    您还可以在PHP中递增字母:
    $i = "a";
    while ($i < "c") {
        echo $i++;
    }
    

    到达z后,接着是aa,依此类推。

    Note that character variables can be incremented but not decremented and even so only plain ASCII characters (a-z and A-Z) are supported.



    堆栈溢出帖子:
  • Understanding Incrementing
  • 关于php - 引用-这个符号在PHP中是什么意思?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13958085/

    相关文章:

    php - 如何将 1 小时添加到约会 Carbon?

    ruby - 获取 `initialize' : wrong number of arguments(1 for 0) (ArgumentError) for simple ruby app

    Python 3 kwargs 洞察

    c++ - 关于如何使用此代码段实现 SFINAE 的问题

    php - 自动更新帖子而无需刷新

    php - mysqli->准备创建表的问题

    python - 在 python 中通过函数传递变量的问题

    language-agnostic - 非二元函数的结合性、交换性和单位元

    Django 查询集 EXCLUDE : are these equivalent?

    php - mysql查询匹配多个单词并使用php显示结果