123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159 |
- Logical operators
- -----
- <?php
- // boolean ops
- $a && $b;
- $a || $b;
- !$a;
- !!$a;
- // logical ops
- $a and $b;
- $a or $b;
- $a xor $b;
- // precedence
- $a && $b || $c && $d;
- $a && ($b || $c) && $d;
- $a = $b || $c;
- $a = $b or $c;
- -----
- array(
- 0: Expr_BinaryOp_BooleanAnd(
- left: Expr_Variable(
- name: a
- comments: array(
- 0: // boolean ops
- )
- )
- right: Expr_Variable(
- name: b
- )
- comments: array(
- 0: // boolean ops
- )
- )
- 1: Expr_BinaryOp_BooleanOr(
- left: Expr_Variable(
- name: a
- )
- right: Expr_Variable(
- name: b
- )
- )
- 2: Expr_BooleanNot(
- expr: Expr_Variable(
- name: a
- )
- )
- 3: Expr_BooleanNot(
- expr: Expr_BooleanNot(
- expr: Expr_Variable(
- name: a
- )
- )
- )
- 4: Expr_BinaryOp_LogicalAnd(
- left: Expr_Variable(
- name: a
- comments: array(
- 0: // logical ops
- )
- )
- right: Expr_Variable(
- name: b
- )
- comments: array(
- 0: // logical ops
- )
- )
- 5: Expr_BinaryOp_LogicalOr(
- left: Expr_Variable(
- name: a
- )
- right: Expr_Variable(
- name: b
- )
- )
- 6: Expr_BinaryOp_LogicalXor(
- left: Expr_Variable(
- name: a
- )
- right: Expr_Variable(
- name: b
- )
- )
- 7: Expr_BinaryOp_BooleanOr(
- left: Expr_BinaryOp_BooleanAnd(
- left: Expr_Variable(
- name: a
- comments: array(
- 0: // precedence
- )
- )
- right: Expr_Variable(
- name: b
- )
- comments: array(
- 0: // precedence
- )
- )
- right: Expr_BinaryOp_BooleanAnd(
- left: Expr_Variable(
- name: c
- )
- right: Expr_Variable(
- name: d
- )
- )
- comments: array(
- 0: // precedence
- )
- )
- 8: Expr_BinaryOp_BooleanAnd(
- left: Expr_BinaryOp_BooleanAnd(
- left: Expr_Variable(
- name: a
- )
- right: Expr_BinaryOp_BooleanOr(
- left: Expr_Variable(
- name: b
- )
- right: Expr_Variable(
- name: c
- )
- )
- )
- right: Expr_Variable(
- name: d
- )
- )
- 9: Expr_Assign(
- var: Expr_Variable(
- name: a
- )
- expr: Expr_BinaryOp_BooleanOr(
- left: Expr_Variable(
- name: b
- )
- right: Expr_Variable(
- name: c
- )
- )
- )
- 10: Expr_BinaryOp_LogicalOr(
- left: Expr_Assign(
- var: Expr_Variable(
- name: a
- )
- expr: Expr_Variable(
- name: b
- )
- )
- right: Expr_Variable(
- name: c
- )
- )
- )
|