xref: /PHP-Parser/test/code/parser/expr/uvs/isset.test (revision 9a5d5c11)
1UVS isset() on temporaries
2-----
3<?php
4
5isset(([0, 1] + [])[0]);
6isset(['a' => 'b']->a);
7isset("str"->a);
8-----
9array(
10    0: Stmt_Expression(
11        expr: Expr_Isset(
12            vars: array(
13                0: Expr_ArrayDimFetch(
14                    var: Expr_BinaryOp_Plus(
15                        left: Expr_Array(
16                            items: array(
17                                0: ArrayItem(
18                                    key: null
19                                    value: Scalar_Int(
20                                        value: 0
21                                    )
22                                    byRef: false
23                                    unpack: false
24                                )
25                                1: ArrayItem(
26                                    key: null
27                                    value: Scalar_Int(
28                                        value: 1
29                                    )
30                                    byRef: false
31                                    unpack: false
32                                )
33                            )
34                        )
35                        right: Expr_Array(
36                            items: array(
37                            )
38                        )
39                    )
40                    dim: Scalar_Int(
41                        value: 0
42                    )
43                )
44            )
45        )
46    )
47    1: Stmt_Expression(
48        expr: Expr_Isset(
49            vars: array(
50                0: Expr_PropertyFetch(
51                    var: Expr_Array(
52                        items: array(
53                            0: ArrayItem(
54                                key: Scalar_String(
55                                    value: a
56                                )
57                                value: Scalar_String(
58                                    value: b
59                                )
60                                byRef: false
61                                unpack: false
62                            )
63                        )
64                    )
65                    name: Identifier(
66                        name: a
67                    )
68                )
69            )
70        )
71    )
72    2: Stmt_Expression(
73        expr: Expr_Isset(
74            vars: array(
75                0: Expr_PropertyFetch(
76                    var: Scalar_String(
77                        value: str
78                    )
79                    name: Identifier(
80                        name: a
81                    )
82                )
83            )
84        )
85    )
86)
87