diff --git a/language/operators.xml b/language/operators.xml index 38b389e137..3d73a0df18 100644 --- a/language/operators.xml +++ b/language/operators.xml @@ -604,6 +604,125 @@ Strict Standards: Assigning the return value of new by reference is deprecated i section of the manual. + + + Arithmetic Assignment Operators + + + + + Example + Equivalent + Operation + + + + + $a += $b + $a = $a + b + Addition + + + $a -= $b + $a = $a - $b + Subtraction + + + $a *= $b + $a = $a * $b + Multiplication + + + $a /= $b + $a = $a / $b + Division + + + $a %= $b + $a = $a % $b + Modulus + + + + + + + + Bitwise Assignment Operators + + + + + Example + Equivalent + Operation + + + + + $a &= $b + $a = $a & $b + Bitwise And + + + $a |= $b + $a = $a | $b + Bitwise Or + + + $a ^= $b + $a = $a ^ $b + Bitwise Xor + + + $a <<= $b + $a = $a << $b + Left Shift + + + $a >>= $b + $a = $a >> $b + Right Shift + + + + + + + + Other Assignment Operators + + + + + Example + Equivalent + Operation + + + + + $a .= $b + $a = $a . $b + String Concatenation + + + $a ??= $b + $a = $a ?? $b + Null Coalesce + + + + + + + + See also the manual sections on + arithmetic operators, bitwise operators, + string operators, and + null coalescing operator. + + @@ -2401,8 +2520,7 @@ bool(false) instanceof does not throw any error if the variable being tested is not - an object, it simply returns &false;. Constants, however, were not allowed - prior to PHP 7.3.0. + an object, it simply returns &false;. Constants, however, are not allowed. Using <literal>instanceof</literal> to test other variables @@ -2425,26 +2543,6 @@ bool(false) bool(false) bool(false) PHP Fatal error: instanceof expects an object instance, constant given -]]> - - - - - As of PHP 7.3.0, constants are allowed on the left-hand-side of the - instanceof operator. - - Using <literal>instanceof</literal> to test constants - - -]]> - - &example.outputs.73; - -