123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621 |
- Expressions in static scalar context
- -----
- <?php
- const T_1 = 1 << 1;
- const T_2 = 1 / 2;
- const T_3 = 1.5 + 1.5;
- const T_4 = "foo" . "bar";
- const T_5 = (1.5 + 1.5) * 2;
- const T_6 = "foo" . 2 . 3 . 4.0;
- const T_7 = __LINE__;
- const T_8 = <<<ENDOFSTRING
- This is a test string
- ENDOFSTRING;
- const T_9 = ~-1;
- const T_10 = (-1?:1) + (0?2:3);
- const T_11 = 1 && 0;
- const T_12 = 1 and 1;
- const T_13 = 0 || 0;
- const T_14 = 1 or 0;
- const T_15 = 1 xor 1;
- const T_16 = 1 xor 0;
- const T_17 = 1 < 0;
- const T_18 = 0 <= 0;
- const T_19 = 1 > 0;
- const T_20 = 1 >= 0;
- const T_21 = 1 === 1;
- const T_22 = 1 !== 1;
- const T_23 = 0 != "0";
- const T_24 = 1 == "1";
- const T_25 = 1 + 2 * 3;
- const T_26 = "1" + 2 + "3";
- const T_27 = 2 ** 3;
- const T_28 = [1, 2, 3][1];
- const T_29 = 12 - 13;
- const T_30 = 12 ^ 13;
- const T_31 = 12 & 13;
- const T_32 = 12 | 13;
- const T_33 = 12 % 3;
- const T_34 = 100 >> 4;
- const T_35 = !false;
- -----
- array(
- 0: Stmt_Const(
- consts: array(
- 0: Const(
- name: T_1
- value: Expr_BinaryOp_ShiftLeft(
- left: Scalar_LNumber(
- value: 1
- )
- right: Scalar_LNumber(
- value: 1
- )
- )
- )
- )
- )
- 1: Stmt_Const(
- consts: array(
- 0: Const(
- name: T_2
- value: Expr_BinaryOp_Div(
- left: Scalar_LNumber(
- value: 1
- )
- right: Scalar_LNumber(
- value: 2
- )
- )
- )
- )
- )
- 2: Stmt_Const(
- consts: array(
- 0: Const(
- name: T_3
- value: Expr_BinaryOp_Plus(
- left: Scalar_DNumber(
- value: 1.5
- )
- right: Scalar_DNumber(
- value: 1.5
- )
- )
- )
- )
- )
- 3: Stmt_Const(
- consts: array(
- 0: Const(
- name: T_4
- value: Expr_BinaryOp_Concat(
- left: Scalar_String(
- value: foo
- )
- right: Scalar_String(
- value: bar
- )
- )
- )
- )
- )
- 4: Stmt_Const(
- consts: array(
- 0: Const(
- name: T_5
- value: Expr_BinaryOp_Mul(
- left: Expr_BinaryOp_Plus(
- left: Scalar_DNumber(
- value: 1.5
- )
- right: Scalar_DNumber(
- value: 1.5
- )
- )
- right: Scalar_LNumber(
- value: 2
- )
- )
- )
- )
- )
- 5: Stmt_Const(
- consts: array(
- 0: Const(
- name: T_6
- value: Expr_BinaryOp_Concat(
- left: Expr_BinaryOp_Concat(
- left: Expr_BinaryOp_Concat(
- left: Scalar_String(
- value: foo
- )
- right: Scalar_LNumber(
- value: 2
- )
- )
- right: Scalar_LNumber(
- value: 3
- )
- )
- right: Scalar_DNumber(
- value: 4
- )
- )
- )
- )
- )
- 6: Stmt_Const(
- consts: array(
- 0: Const(
- name: T_7
- value: Scalar_MagicConst_Line(
- )
- )
- )
- )
- 7: Stmt_Const(
- consts: array(
- 0: Const(
- name: T_8
- value: Scalar_String(
- value: This is a test string
- )
- )
- )
- )
- 8: Stmt_Const(
- consts: array(
- 0: Const(
- name: T_9
- value: Expr_BitwiseNot(
- expr: Expr_UnaryMinus(
- expr: Scalar_LNumber(
- value: 1
- )
- )
- )
- )
- )
- )
- 9: Stmt_Const(
- consts: array(
- 0: Const(
- name: T_10
- value: Expr_BinaryOp_Plus(
- left: Expr_Ternary(
- cond: Expr_UnaryMinus(
- expr: Scalar_LNumber(
- value: 1
- )
- )
- if: null
- else: Scalar_LNumber(
- value: 1
- )
- )
- right: Expr_Ternary(
- cond: Scalar_LNumber(
- value: 0
- )
- if: Scalar_LNumber(
- value: 2
- )
- else: Scalar_LNumber(
- value: 3
- )
- )
- )
- )
- )
- )
- 10: Stmt_Const(
- consts: array(
- 0: Const(
- name: T_11
- value: Expr_BinaryOp_BooleanAnd(
- left: Scalar_LNumber(
- value: 1
- )
- right: Scalar_LNumber(
- value: 0
- )
- )
- )
- )
- )
- 11: Stmt_Const(
- consts: array(
- 0: Const(
- name: T_12
- value: Expr_BinaryOp_LogicalAnd(
- left: Scalar_LNumber(
- value: 1
- )
- right: Scalar_LNumber(
- value: 1
- )
- )
- )
- )
- )
- 12: Stmt_Const(
- consts: array(
- 0: Const(
- name: T_13
- value: Expr_BinaryOp_BooleanOr(
- left: Scalar_LNumber(
- value: 0
- )
- right: Scalar_LNumber(
- value: 0
- )
- )
- )
- )
- )
- 13: Stmt_Const(
- consts: array(
- 0: Const(
- name: T_14
- value: Expr_BinaryOp_LogicalOr(
- left: Scalar_LNumber(
- value: 1
- )
- right: Scalar_LNumber(
- value: 0
- )
- )
- )
- )
- )
- 14: Stmt_Const(
- consts: array(
- 0: Const(
- name: T_15
- value: Expr_BinaryOp_LogicalXor(
- left: Scalar_LNumber(
- value: 1
- )
- right: Scalar_LNumber(
- value: 1
- )
- )
- )
- )
- )
- 15: Stmt_Const(
- consts: array(
- 0: Const(
- name: T_16
- value: Expr_BinaryOp_LogicalXor(
- left: Scalar_LNumber(
- value: 1
- )
- right: Scalar_LNumber(
- value: 0
- )
- )
- )
- )
- )
- 16: Stmt_Const(
- consts: array(
- 0: Const(
- name: T_17
- value: Expr_BinaryOp_Smaller(
- left: Scalar_LNumber(
- value: 1
- )
- right: Scalar_LNumber(
- value: 0
- )
- )
- )
- )
- )
- 17: Stmt_Const(
- consts: array(
- 0: Const(
- name: T_18
- value: Expr_BinaryOp_SmallerOrEqual(
- left: Scalar_LNumber(
- value: 0
- )
- right: Scalar_LNumber(
- value: 0
- )
- )
- )
- )
- )
- 18: Stmt_Const(
- consts: array(
- 0: Const(
- name: T_19
- value: Expr_BinaryOp_Greater(
- left: Scalar_LNumber(
- value: 1
- )
- right: Scalar_LNumber(
- value: 0
- )
- )
- )
- )
- )
- 19: Stmt_Const(
- consts: array(
- 0: Const(
- name: T_20
- value: Expr_BinaryOp_GreaterOrEqual(
- left: Scalar_LNumber(
- value: 1
- )
- right: Scalar_LNumber(
- value: 0
- )
- )
- )
- )
- )
- 20: Stmt_Const(
- consts: array(
- 0: Const(
- name: T_21
- value: Expr_BinaryOp_Identical(
- left: Scalar_LNumber(
- value: 1
- )
- right: Scalar_LNumber(
- value: 1
- )
- )
- )
- )
- )
- 21: Stmt_Const(
- consts: array(
- 0: Const(
- name: T_22
- value: Expr_BinaryOp_NotIdentical(
- left: Scalar_LNumber(
- value: 1
- )
- right: Scalar_LNumber(
- value: 1
- )
- )
- )
- )
- )
- 22: Stmt_Const(
- consts: array(
- 0: Const(
- name: T_23
- value: Expr_BinaryOp_NotEqual(
- left: Scalar_LNumber(
- value: 0
- )
- right: Scalar_String(
- value: 0
- )
- )
- )
- )
- )
- 23: Stmt_Const(
- consts: array(
- 0: Const(
- name: T_24
- value: Expr_BinaryOp_Equal(
- left: Scalar_LNumber(
- value: 1
- )
- right: Scalar_String(
- value: 1
- )
- )
- )
- )
- )
- 24: Stmt_Const(
- consts: array(
- 0: Const(
- name: T_25
- value: Expr_BinaryOp_Plus(
- left: Scalar_LNumber(
- value: 1
- )
- right: Expr_BinaryOp_Mul(
- left: Scalar_LNumber(
- value: 2
- )
- right: Scalar_LNumber(
- value: 3
- )
- )
- )
- )
- )
- )
- 25: Stmt_Const(
- consts: array(
- 0: Const(
- name: T_26
- value: Expr_BinaryOp_Plus(
- left: Expr_BinaryOp_Plus(
- left: Scalar_String(
- value: 1
- )
- right: Scalar_LNumber(
- value: 2
- )
- )
- right: Scalar_String(
- value: 3
- )
- )
- )
- )
- )
- 26: Stmt_Const(
- consts: array(
- 0: Const(
- name: T_27
- value: Expr_BinaryOp_Pow(
- left: Scalar_LNumber(
- value: 2
- )
- right: Scalar_LNumber(
- value: 3
- )
- )
- )
- )
- )
- 27: Stmt_Const(
- consts: array(
- 0: Const(
- name: T_28
- value: Expr_ArrayDimFetch(
- var: Expr_Array(
- items: array(
- 0: Expr_ArrayItem(
- key: null
- value: Scalar_LNumber(
- value: 1
- )
- byRef: false
- )
- 1: Expr_ArrayItem(
- key: null
- value: Scalar_LNumber(
- value: 2
- )
- byRef: false
- )
- 2: Expr_ArrayItem(
- key: null
- value: Scalar_LNumber(
- value: 3
- )
- byRef: false
- )
- )
- )
- dim: Scalar_LNumber(
- value: 1
- )
- )
- )
- )
- )
- 28: Stmt_Const(
- consts: array(
- 0: Const(
- name: T_29
- value: Expr_BinaryOp_Minus(
- left: Scalar_LNumber(
- value: 12
- )
- right: Scalar_LNumber(
- value: 13
- )
- )
- )
- )
- )
- 29: Stmt_Const(
- consts: array(
- 0: Const(
- name: T_30
- value: Expr_BinaryOp_BitwiseXor(
- left: Scalar_LNumber(
- value: 12
- )
- right: Scalar_LNumber(
- value: 13
- )
- )
- )
- )
- )
- 30: Stmt_Const(
- consts: array(
- 0: Const(
- name: T_31
- value: Expr_BinaryOp_BitwiseAnd(
- left: Scalar_LNumber(
- value: 12
- )
- right: Scalar_LNumber(
- value: 13
- )
- )
- )
- )
- )
- 31: Stmt_Const(
- consts: array(
- 0: Const(
- name: T_32
- value: Expr_BinaryOp_BitwiseOr(
- left: Scalar_LNumber(
- value: 12
- )
- right: Scalar_LNumber(
- value: 13
- )
- )
- )
- )
- )
- 32: Stmt_Const(
- consts: array(
- 0: Const(
- name: T_33
- value: Expr_BinaryOp_Mod(
- left: Scalar_LNumber(
- value: 12
- )
- right: Scalar_LNumber(
- value: 3
- )
- )
- )
- )
- )
- 33: Stmt_Const(
- consts: array(
- 0: Const(
- name: T_34
- value: Expr_BinaryOp_ShiftRight(
- left: Scalar_LNumber(
- value: 100
- )
- right: Scalar_LNumber(
- value: 4
- )
- )
- )
- )
- )
- 34: Stmt_Const(
- consts: array(
- 0: Const(
- name: T_35
- value: Expr_BooleanNot(
- expr: Expr_ConstFetch(
- name: Name(
- parts: array(
- 0: false
- )
- )
- )
- )
- )
- )
- )
- )
|