PHP Операторы

Оператор это символ, который выполняет операции над операндами

Пример:

$num=10+20;//+ это оператор, а 10,20 операнды. $num - переменная.

Операторы PHP могут быть классифицированы в следующих формах:

Так же мы можем классифицировать операторы от имени операндов

** arithmetic right ++ -- ~ (int) (float) (string) (array) (object) (bool) @ increment/decrement and types right instanceof types non-associative ! logical (negation) right * / % arithmetic left + - . arithmetic and string concatenation left << >> bitwise (shift) left < <= > >= comparison non-associative == != === !== <> comparison non-associative & bitwise AND left ^ bitwise XOR left | bitwise OR left && logical AND left || logical OR left ?: ternary left = += -= *= **= /= .= %= &= |= ^= <<= >>= => assignment right and logical left xor logical left or logical left , many uses (comma) left
Операторы Допоонительная информацмя Ассоциативность
clone new clone and new non-associative
[ array() left