php-parser/test/code/parser/scalar/encapsedString.test

294 lines
6.0 KiB
Plaintext
Raw Normal View History

2011-11-26 17:10:18 +01:00
Encapsed strings
-----
<?php
2011-11-27 11:20:35 +01:00
2011-11-26 17:10:18 +01:00
"$A";
"$A->B";
"$A[B]";
"$A[0]";
2016-12-07 20:22:53 +01:00
"$A[1234]";
"$A[9223372036854775808]";
"$A[000]";
2011-11-26 17:10:18 +01:00
"$A[0x0]";
2016-12-07 20:22:53 +01:00
"$A[0b0]";
2011-12-07 18:17:05 +01:00
"$A[$B]";
2011-11-26 17:10:18 +01:00
"{$A}";
"{$A['B']}";
"${A}";
"${A['B']}";
"${$A}";
"\{$A}";
"\{ $A }";
"\\{$A}";
"\\{ $A }";
"{$$A}[B]";
"$$A[B]";
2011-11-26 17:10:18 +01:00
"A $B C";
b"$A";
B"$A";
2011-11-26 17:10:18 +01:00
-----
array(
0: Scalar_Encapsed(
parts: array(
0: Expr_Variable(
name: A
)
)
)
1: Scalar_Encapsed(
parts: array(
0: Expr_PropertyFetch(
var: Expr_Variable(
name: A
)
name: B
)
)
)
2: Scalar_Encapsed(
parts: array(
0: Expr_ArrayDimFetch(
var: Expr_Variable(
name: A
)
dim: Scalar_String(
value: B
)
)
)
)
3: Scalar_Encapsed(
parts: array(
0: Expr_ArrayDimFetch(
var: Expr_Variable(
name: A
)
2016-12-07 20:22:53 +01:00
dim: Scalar_LNumber(
2011-11-26 17:10:18 +01:00
value: 0
)
)
)
)
4: Scalar_Encapsed(
2016-12-07 20:22:53 +01:00
parts: array(
0: Expr_ArrayDimFetch(
var: Expr_Variable(
name: A
)
dim: Scalar_LNumber(
value: 1234
)
)
)
)
5: Scalar_Encapsed(
parts: array(
0: Expr_ArrayDimFetch(
var: Expr_Variable(
name: A
)
dim: Scalar_String(
value: 9223372036854775808
)
)
)
)
6: Scalar_Encapsed(
parts: array(
0: Expr_ArrayDimFetch(
var: Expr_Variable(
name: A
)
dim: Scalar_String(
value: 000
)
)
)
)
7: Scalar_Encapsed(
2011-11-26 17:10:18 +01:00
parts: array(
0: Expr_ArrayDimFetch(
var: Expr_Variable(
name: A
)
dim: Scalar_String(
value: 0x0
)
)
)
)
2016-12-07 20:22:53 +01:00
8: Scalar_Encapsed(
parts: array(
0: Expr_ArrayDimFetch(
var: Expr_Variable(
name: A
)
dim: Scalar_String(
value: 0b0
)
)
)
)
9: Scalar_Encapsed(
2011-12-07 18:17:05 +01:00
parts: array(
0: Expr_ArrayDimFetch(
var: Expr_Variable(
name: A
)
dim: Expr_Variable(
name: B
)
)
)
)
2016-12-07 20:22:53 +01:00
10: Scalar_Encapsed(
2011-11-26 17:10:18 +01:00
parts: array(
0: Expr_Variable(
name: A
)
)
)
2016-12-07 20:22:53 +01:00
11: Scalar_Encapsed(
2011-11-26 17:10:18 +01:00
parts: array(
0: Expr_ArrayDimFetch(
var: Expr_Variable(
name: A
)
dim: Scalar_String(
value: B
)
)
)
)
2016-12-07 20:22:53 +01:00
12: Scalar_Encapsed(
2011-11-26 17:10:18 +01:00
parts: array(
0: Expr_Variable(
name: A
)
)
)
2016-12-07 20:22:53 +01:00
13: Scalar_Encapsed(
2011-11-26 17:10:18 +01:00
parts: array(
0: Expr_ArrayDimFetch(
var: Expr_Variable(
name: A
)
dim: Scalar_String(
value: B
)
)
)
)
2016-12-07 20:22:53 +01:00
14: Scalar_Encapsed(
2011-11-26 17:10:18 +01:00
parts: array(
0: Expr_Variable(
name: Expr_Variable(
name: A
)
)
)
)
2016-12-07 20:22:53 +01:00
15: Scalar_Encapsed(
parts: array(
2015-12-03 22:55:07 +01:00
0: Scalar_EncapsedStringPart(
value: \{
)
1: Expr_Variable(
name: A
)
2015-12-03 22:55:07 +01:00
2: Scalar_EncapsedStringPart(
value: }
)
)
)
2016-12-07 20:22:53 +01:00
16: Scalar_Encapsed(
parts: array(
2015-12-03 22:55:07 +01:00
0: Scalar_EncapsedStringPart(
value: \{
)
1: Expr_Variable(
name: A
)
2015-12-03 22:55:07 +01:00
2: Scalar_EncapsedStringPart(
value: }
)
)
)
2016-12-07 20:22:53 +01:00
17: Scalar_Encapsed(
parts: array(
2015-12-03 22:55:07 +01:00
0: Scalar_EncapsedStringPart(
value: \
)
1: Expr_Variable(
name: A
)
)
)
2016-12-07 20:22:53 +01:00
18: Scalar_Encapsed(
parts: array(
2015-12-03 22:55:07 +01:00
0: Scalar_EncapsedStringPart(
value: \{
)
1: Expr_Variable(
name: A
)
2015-12-03 22:55:07 +01:00
2: Scalar_EncapsedStringPart(
value: }
)
)
)
2016-12-07 20:22:53 +01:00
19: Scalar_Encapsed(
parts: array(
0: Expr_Variable(
name: Expr_Variable(
name: A
)
)
2015-12-03 22:55:07 +01:00
1: Scalar_EncapsedStringPart(
value: [B]
)
)
)
2016-12-07 20:22:53 +01:00
20: Scalar_Encapsed(
parts: array(
2015-12-03 22:55:07 +01:00
0: Scalar_EncapsedStringPart(
value: $
)
1: Expr_ArrayDimFetch(
var: Expr_Variable(
name: A
)
dim: Scalar_String(
value: B
)
)
)
)
2016-12-07 20:22:53 +01:00
21: Scalar_Encapsed(
2011-11-26 17:10:18 +01:00
parts: array(
2015-12-03 22:55:07 +01:00
0: Scalar_EncapsedStringPart(
value: A
)
2011-11-26 17:10:18 +01:00
1: Expr_Variable(
name: B
)
2015-12-03 22:55:07 +01:00
2: Scalar_EncapsedStringPart(
value: C
)
2011-11-26 17:10:18 +01:00
)
)
2016-12-07 20:22:53 +01:00
22: Scalar_Encapsed(
2011-11-26 17:10:18 +01:00
parts: array(
0: Expr_Variable(
name: A
)
)
)
2016-12-07 20:22:53 +01:00
23: Scalar_Encapsed(
parts: array(
0: Expr_Variable(
name: A
)
)
)
2015-12-03 22:55:07 +01:00
)