1
0
mirror of https://github.com/danog/PHP-Parser.git synced 2024-12-11 17:09:41 +01:00
PHP-Parser/test/code/prettyPrinter/expr/operators.test
Tomas Votruba 9de96821f7 Add support for ??= operator
Introduced in PHP 5.4, represented using an AssignOp\Coalesce node.
2019-02-09 11:16:26 +01:00

152 lines
1.4 KiB
Plaintext

Basic operators
-----
<?php
$a ** $b;
++$a;
--$a;
$a++;
$a--;
@$a;
~$a;
-$a;
+$a;
(int) $a;
(integer) $a;
(float) $a;
(double) $a;
(real) $a;
( float) $a;
(double ) $a;
( REAL ) $a;
(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;
$a <=> $b;
$a & $b;
$a ^ $b;
$a | $b;
$a && $b;
$a || $b;
$a ? $b : $c;
$a ?: $c;
$a ?? $c;
$a = $b;
$a **= $b;
$a ??= $c;
$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;
(float) $a;
(double) $a;
(real) $a;
(float) $a;
(double) $a;
(real) $a;
(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;
$a <=> $b;
$a & $b;
$a ^ $b;
$a | $b;
$a && $b;
$a || $b;
$a ? $b : $c;
$a ?: $c;
$a ?? $c;
$a = $b;
$a **= $b;
$a ??= $c;
$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;