OperatorExampleNameResult
**$a ** $bExponentiationResult of raising $a to the $b'th power.
++$aUnary +Convert $a to a number (int or float)
--$aUnary -Negation of $a.
~~ $aBitwise NotBits that are set in $a are not set, and vice versa.
(int)(int)$aCast to IntThe value of $a as an int.
(float)(float)$aCast to FloatThe value of $a as a float.
(string)(string)$aCast to StringThe value of $a as a string.
(bool)(bool)$aCast to a BoolThe value of $a as a bool.
@@$aError ControlAny errors caused by the expression are suppressed.
!!$aLogical Nottrue if $a is not true.
*$a * $bMultiplicationProduct of $a and $b.
/$a / $bDivisionQuotient of $a and $b.
%$a % $bModuloRemainder of $a divided by $b.
+$a + $bAdditionSum of $a and $b.
-$a - $bSubtractionDifference of $a and $b.
.$a . $bConcatenationConcatenation of the two string values.
[[$a [[ $bShift LeftShift the bits of $a $b steps to the left.
]]$a ]] $bShift RightShift the bits of $a $b steps to the right.
<$a < $bLess Thantrue if $a is strictly less than $b.
<=$a <= $bLess Than or Equal Totrue if $a is less than or equal to $b.
>$a > $bGreater Thantrue if $a is strictly greater than $b.
>=$a >= $bGreater Than or Equal Totrue if $a is greater than or equal to $b.
==$a == $bEquaLtrue if $a is equal to $b.
!=$a != $b Not equaltrue if $a is not equal to $b.
===$a === $bIdenticaLtrue if $a is equal to $b, and they are of the same type.
!==$a !== $bNot Identicaltrue if $a is not equal to $b, or they are not of the same type.
&$a & $bBitwise AndBits that are set in both $a and $b are set.
^$a ^ $bBitwise Exclusive OrBits that are set in $a or $b but not both are set.
|$a | $bBitwise OrBits that are set in either $a or $b are set.
&&$a && $bLogical Andtrue if both $a and $b are true.
||$a || $bOrtrue if either $a or $b is true.
??$a ?? $bNull Coalescing$a if $a is not null or $b if $a is null.
? :$a ? $b : $cTernaryValue of $b if $a is true, else value of $c.

 

The table is in order of precedence with operators of equal precedence grouped using the background color of the rows.