123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301 |
- Assignments
- -----
- <?php
- // simple assign
- $a = $b;
- // combined assign
- $a &= $b;
- $a |= $b;
- $a ^= $b;
- $a .= $b;
- $a /= $b;
- $a -= $b;
- $a %= $b;
- $a *= $b;
- $a += $b;
- $a <<= $b;
- $a >>= $b;
- $a **= $b;
- // chained assign
- $a = $b *= $c **= $d;
- // by ref assign
- $a =& $b;
- // list() assign
- list($a) = $b;
- list($a, , $b) = $c;
- list($a, list(, $c), $d) = $e;
- // inc/dec
- ++$a;
- $a++;
- --$a;
- $a--;
- -----
- array(
- 0: Expr_Assign(
- var: Expr_Variable(
- name: a
- comments: array(
- 0: // simple assign
- )
- )
- expr: Expr_Variable(
- name: b
- )
- comments: array(
- 0: // simple assign
- )
- )
- 1: Expr_AssignOp_BitwiseAnd(
- var: Expr_Variable(
- name: a
- comments: array(
- 0: // combined assign
- )
- )
- expr: Expr_Variable(
- name: b
- )
- comments: array(
- 0: // combined assign
- )
- )
- 2: Expr_AssignOp_BitwiseOr(
- var: Expr_Variable(
- name: a
- )
- expr: Expr_Variable(
- name: b
- )
- )
- 3: Expr_AssignOp_BitwiseXor(
- var: Expr_Variable(
- name: a
- )
- expr: Expr_Variable(
- name: b
- )
- )
- 4: Expr_AssignOp_Concat(
- var: Expr_Variable(
- name: a
- )
- expr: Expr_Variable(
- name: b
- )
- )
- 5: Expr_AssignOp_Div(
- var: Expr_Variable(
- name: a
- )
- expr: Expr_Variable(
- name: b
- )
- )
- 6: Expr_AssignOp_Minus(
- var: Expr_Variable(
- name: a
- )
- expr: Expr_Variable(
- name: b
- )
- )
- 7: Expr_AssignOp_Mod(
- var: Expr_Variable(
- name: a
- )
- expr: Expr_Variable(
- name: b
- )
- )
- 8: Expr_AssignOp_Mul(
- var: Expr_Variable(
- name: a
- )
- expr: Expr_Variable(
- name: b
- )
- )
- 9: Expr_AssignOp_Plus(
- var: Expr_Variable(
- name: a
- )
- expr: Expr_Variable(
- name: b
- )
- )
- 10: Expr_AssignOp_ShiftLeft(
- var: Expr_Variable(
- name: a
- )
- expr: Expr_Variable(
- name: b
- )
- )
- 11: Expr_AssignOp_ShiftRight(
- var: Expr_Variable(
- name: a
- )
- expr: Expr_Variable(
- name: b
- )
- )
- 12: Expr_AssignOp_Pow(
- var: Expr_Variable(
- name: a
- )
- expr: Expr_Variable(
- name: b
- )
- )
- 13: Expr_Assign(
- var: Expr_Variable(
- name: a
- comments: array(
- 0: // chained assign
- )
- )
- expr: Expr_AssignOp_Mul(
- var: Expr_Variable(
- name: b
- )
- expr: Expr_AssignOp_Pow(
- var: Expr_Variable(
- name: c
- )
- expr: Expr_Variable(
- name: d
- )
- )
- )
- comments: array(
- 0: // chained assign
- )
- )
- 14: Expr_AssignRef(
- var: Expr_Variable(
- name: a
- comments: array(
- 0: // by ref assign
- )
- )
- expr: Expr_Variable(
- name: b
- )
- comments: array(
- 0: // by ref assign
- )
- )
- 15: Expr_Assign(
- var: Expr_List(
- items: array(
- 0: Expr_ArrayItem(
- key: null
- value: Expr_Variable(
- name: a
- )
- byRef: false
- )
- )
- comments: array(
- 0: // list() assign
- )
- )
- expr: Expr_Variable(
- name: b
- )
- comments: array(
- 0: // list() assign
- )
- )
- 16: Expr_Assign(
- var: Expr_List(
- items: array(
- 0: Expr_ArrayItem(
- key: null
- value: Expr_Variable(
- name: a
- )
- byRef: false
- )
- 1: null
- 2: Expr_ArrayItem(
- key: null
- value: Expr_Variable(
- name: b
- )
- byRef: false
- )
- )
- )
- expr: Expr_Variable(
- name: c
- )
- )
- 17: Expr_Assign(
- var: Expr_List(
- items: array(
- 0: Expr_ArrayItem(
- key: null
- value: Expr_Variable(
- name: a
- )
- byRef: false
- )
- 1: Expr_ArrayItem(
- key: null
- value: Expr_List(
- items: array(
- 0: null
- 1: Expr_ArrayItem(
- key: null
- value: Expr_Variable(
- name: c
- )
- byRef: false
- )
- )
- )
- byRef: false
- )
- 2: Expr_ArrayItem(
- key: null
- value: Expr_Variable(
- name: d
- )
- byRef: false
- )
- )
- )
- expr: Expr_Variable(
- name: e
- )
- )
- 18: Expr_PreInc(
- var: Expr_Variable(
- name: a
- )
- comments: array(
- 0: // inc/dec
- )
- )
- 19: Expr_PostInc(
- var: Expr_Variable(
- name: a
- )
- )
- 20: Expr_PreDec(
- var: Expr_Variable(
- name: a
- )
- )
- 21: Expr_PostDec(
- var: Expr_Variable(
- name: a
- )
- )
- )
|