2015-01-18 19:57:09 +01:00
|
|
|
Basic operators
|
|
|
|
-----
|
|
|
|
<?php
|
|
|
|
|
|
|
|
$a ** $b;
|
|
|
|
|
|
|
|
++$a;
|
|
|
|
--$a;
|
|
|
|
$a++;
|
|
|
|
$a--;
|
|
|
|
|
|
|
|
@$a;
|
|
|
|
~$a;
|
|
|
|
-$a;
|
|
|
|
+$a;
|
|
|
|
|
|
|
|
(int) $a;
|
|
|
|
(integer) $a;
|
|
|
|
(float) $a;
|
|
|
|
(double) $a;
|
|
|
|
(real) $a;
|
2019-01-03 08:59:45 +01:00
|
|
|
( float) $a;
|
|
|
|
(double ) $a;
|
|
|
|
( REAL ) $a;
|
2015-01-18 19:57:09 +01:00
|
|
|
(string) $a;
|
|
|
|
(binary) $a;
|
|
|
|
(array) $a;
|
|
|
|
(object) $a;
|
|
|
|
(bool) $a;
|
|
|
|
(boolean) $a;
|
|
|
|
(unset) $a;
|
|
|
|
|
|
|
|
$a * $b;
|
|
|
|
$a / $b;
|
|
|
|
$a % $b;
|
|
|
|
$a + $b;
|
|
|
|
$a - $b;
|
|
|
|
$a . $b;
|
|
|
|
$a << $b;
|
|
|
|
$a >> $b;
|
|
|
|
$a < $b;
|
|
|
|
$a <= $b;
|
|
|
|
$a > $b;
|
|
|
|
$a >= $b;
|
|
|
|
$a == $b;
|
|
|
|
$a != $b;
|
|
|
|
$a <> $b;
|
|
|
|
$a === $b;
|
|
|
|
$a !== $b;
|
2015-03-12 23:13:31 +01:00
|
|
|
$a <=> $b;
|
2015-01-18 19:57:09 +01:00
|
|
|
$a & $b;
|
|
|
|
$a ^ $b;
|
|
|
|
$a | $b;
|
|
|
|
$a && $b;
|
|
|
|
$a || $b;
|
|
|
|
$a ? $b : $c;
|
|
|
|
$a ?: $c;
|
2015-03-12 22:45:38 +01:00
|
|
|
$a ?? $c;
|
2015-01-18 19:57:09 +01:00
|
|
|
|
|
|
|
$a = $b;
|
|
|
|
$a **= $b;
|
|
|
|
$a *= $b;
|
|
|
|
$a /= $b;
|
|
|
|
$a %= $b;
|
|
|
|
$a += $b;
|
|
|
|
$a -= $b;
|
|
|
|
$a .= $b;
|
|
|
|
$a <<= $b;
|
|
|
|
$a >>= $b;
|
|
|
|
$a &= $b;
|
|
|
|
$a ^= $b;
|
|
|
|
$a |= $b;
|
|
|
|
$a =& $b;
|
|
|
|
|
|
|
|
$a and $b;
|
|
|
|
$a xor $b;
|
|
|
|
$a or $b;
|
|
|
|
|
|
|
|
$a instanceof Foo;
|
|
|
|
$a instanceof $b;
|
|
|
|
-----
|
|
|
|
$a ** $b;
|
|
|
|
++$a;
|
|
|
|
--$a;
|
|
|
|
$a++;
|
|
|
|
$a--;
|
|
|
|
@$a;
|
|
|
|
~$a;
|
|
|
|
-$a;
|
|
|
|
+$a;
|
|
|
|
(int) $a;
|
|
|
|
(int) $a;
|
2019-01-03 08:59:45 +01:00
|
|
|
(float) $a;
|
2015-01-18 19:57:09 +01:00
|
|
|
(double) $a;
|
2019-01-03 08:59:45 +01:00
|
|
|
(real) $a;
|
|
|
|
(float) $a;
|
2015-01-18 19:57:09 +01:00
|
|
|
(double) $a;
|
2019-01-03 08:59:45 +01:00
|
|
|
(real) $a;
|
2015-01-18 19:57:09 +01:00
|
|
|
(string) $a;
|
|
|
|
(string) $a;
|
|
|
|
(array) $a;
|
|
|
|
(object) $a;
|
|
|
|
(bool) $a;
|
|
|
|
(bool) $a;
|
|
|
|
(unset) $a;
|
|
|
|
$a * $b;
|
|
|
|
$a / $b;
|
|
|
|
$a % $b;
|
|
|
|
$a + $b;
|
|
|
|
$a - $b;
|
|
|
|
$a . $b;
|
|
|
|
$a << $b;
|
|
|
|
$a >> $b;
|
|
|
|
$a < $b;
|
|
|
|
$a <= $b;
|
|
|
|
$a > $b;
|
|
|
|
$a >= $b;
|
|
|
|
$a == $b;
|
|
|
|
$a != $b;
|
|
|
|
$a != $b;
|
|
|
|
$a === $b;
|
|
|
|
$a !== $b;
|
2015-03-12 23:13:31 +01:00
|
|
|
$a <=> $b;
|
2015-01-18 19:57:09 +01:00
|
|
|
$a & $b;
|
|
|
|
$a ^ $b;
|
|
|
|
$a | $b;
|
|
|
|
$a && $b;
|
|
|
|
$a || $b;
|
|
|
|
$a ? $b : $c;
|
|
|
|
$a ?: $c;
|
2015-03-12 22:45:38 +01:00
|
|
|
$a ?? $c;
|
2015-01-18 19:57:09 +01:00
|
|
|
$a = $b;
|
|
|
|
$a **= $b;
|
|
|
|
$a *= $b;
|
|
|
|
$a /= $b;
|
|
|
|
$a %= $b;
|
|
|
|
$a += $b;
|
|
|
|
$a -= $b;
|
|
|
|
$a .= $b;
|
|
|
|
$a <<= $b;
|
|
|
|
$a >>= $b;
|
|
|
|
$a &= $b;
|
|
|
|
$a ^= $b;
|
|
|
|
$a |= $b;
|
|
|
|
$a =& $b;
|
|
|
|
$a and $b;
|
|
|
|
$a xor $b;
|
|
|
|
$a or $b;
|
|
|
|
$a instanceof Foo;
|
|
|
|
$a instanceof $b;
|