1Nowdoc and heredoc strings
2-----
3<?php
4
5// empty strings
6<<<'EOS'
7EOS;
8<<<EOS
9EOS;
10
11// constant encapsed strings
12<<<'EOS'
13Test '" $a \n
14EOS;
15<<<EOS
16Test '" \$a \n
17EOS;
18
19// encapsed strings
20<<<EOS
21Test $a
22EOS;
23<<<EOS
24Test $a and $b->c test
25EOS;
26
27b<<<EOS
28Binary
29EOS;
30
31<<<EOS
32$x\r
33EOS;
34
35-----
36array(
37    0: Stmt_Expression(
38        expr: Scalar_String(
39            value:
40        )
41        comments: array(
42            0: // empty strings
43        )
44    )
45    1: Stmt_Expression(
46        expr: Scalar_String(
47            value:
48        )
49    )
50    2: Stmt_Expression(
51        expr: Scalar_String(
52            value: Test '" $a \n
53        )
54        comments: array(
55            0: // constant encapsed strings
56        )
57    )
58    3: Stmt_Expression(
59        expr: Scalar_String(
60            value: Test '" $a
61
62        )
63    )
64    4: Stmt_Expression(
65        expr: Scalar_InterpolatedString(
66            parts: array(
67                0: InterpolatedStringPart(
68                    value: Test
69                )
70                1: Expr_Variable(
71                    name: a
72                )
73            )
74        )
75        comments: array(
76            0: // encapsed strings
77        )
78    )
79    5: Stmt_Expression(
80        expr: Scalar_InterpolatedString(
81            parts: array(
82                0: InterpolatedStringPart(
83                    value: Test
84                )
85                1: Expr_Variable(
86                    name: a
87                )
88                2: InterpolatedStringPart(
89                    value:  and
90                )
91                3: Expr_PropertyFetch(
92                    var: Expr_Variable(
93                        name: b
94                    )
95                    name: Identifier(
96                        name: c
97                    )
98                )
99                4: InterpolatedStringPart(
100                    value:  test
101                )
102            )
103        )
104    )
105    6: Stmt_Expression(
106        expr: Scalar_String(
107            value: Binary
108        )
109    )
110    7: Stmt_Expression(
111        expr: Scalar_InterpolatedString(
112            parts: array(
113                0: Expr_Variable(
114                    name: x
115                )
116                1: InterpolatedStringPart(
117                    value:
118                )
119            )
120        )
121    )
122)
123