0v1.ro

(zero V unu)

Operators list

Arithmetic Operators

Example Name Result
$a Negation Opposite of $a.
$a + $b Addition Sum of $a and $b.
$a $b Subtraction Difference of $a and $b.
$a * $b Multiplication Product of $a and $b.
$a / $b Division Quotient of $a and $b.
$a % $b Modulus Remainder of $a divided by $b.

Assignment Operators

 Assignment by Reference

 Bitwise Operators

Format Name Example
$a & $b And 1001 & 0101  = 0001
$a | $b Or (inclusive or) 1001 | 0101 = 1101
$a ^ $b Xor (exclusive or) 1001 ^ 0101  = 0100
~ $a Not ~ 1001 = 0110
$a << $b Shift left 0010 << 1 = 0100
$a >> $b Shift right Shift the bits of $a $b steps to the right (each step means “divide by two”)